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.worksForUs()} replace={true} />;
  }
  return <Navigate to={routes.client.worksTraits()} replace={true} />;
}

export default WorksRouterPage;
