import { useMode } from "../../stores/useMode";
import { MODES } from "../../config";
import { PendingTable } from "./PendingTable/PendingTable";
import { OnApprovalTable } from "./OnApprovalTable/OnApprovalTable";
import { WorkingTable } from "./WorkingTable/WorkingTable";

export const TableWrapper = ({ fullWidth }) => {
  const { mode } = useMode();

  if (mode === MODES.ON_APPROVAL) {
    return <OnApprovalTable fullWidth={fullWidth} />;
  }

  if (mode === MODES.WORKING) {
    return <WorkingTable fullWidth={fullWidth} />;
  }

  return <PendingTable fullWidth={fullWidth} />;
};
