import React from "react"; import { Params, useLoaderData, useParams, Link } from "react-router"; import { OrderSetProps, OrderSets } from "./OrderSets"; import { ProfileVerification } from "./ProfileVerification"; import { Title } from "@mantine/core"; export const subOrderSetsLoader = async ({ params: { username }, }: { params: Params; }) => fetch(`/api/orders/${username}/sets`).then((response) => response.json()); export const SubOrderSets: React.FC = () => { const { username: sub_username } = useParams(); const orderSets = useLoaderData(); const [profile, setProfile] = React.useState(null); React.useEffect(() => { fetch(`/api/subs/${sub_username}`) .then((response) => response.json()) .then(setProfile); }, [sub_username]); return ( <> Return to dashboard} /> {profile ? ( <> Sub Profile ) : null} ); };