import { useMode } from "../../stores/useMode";
import { MODES } from "../../config";
import { InitialTable } from "./InitialTable/InitialTable";
import { ApproveAndWorkingTable } from "./ApproveAndWorkingTable/ApproveAndWorkingTable";
import { WorkingTable } from "./WorkingTable/WorkingTable";

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

  if (mode === MODES.APPROVE_WORKING) {
    return <ApproveAndWorkingTable fullWidth={fullWidth} />;
  }

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

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