import routes from "@/routes";
import { selectors } from "@/store";
import { useSelector } from "react-redux";
import { Navigate } from "react-router-dom";

function WorksRouterPage() {
  const { flowChoice } = useSelector(selectors.selectQuestionnaire);
  if (["relationship", "married"].includes(flowChoice)) {
    return <Navigate to={routes.client.worksForUsV1()} replace={true} />;
  }
  return <Navigate to={routes.client.worksTraitsV1()} replace={true} />;
}

export default WorksRouterPage;
