2026-01-30 19:24:48 +00:00
|
|
|
import { Container, Title, Card, Text, Box, Flex, Badge } from "@mantine/core";
|
2026-01-30 16:18:49 +00:00
|
|
|
import { TimeValue } from "@mantine/dates";
|
2026-01-30 19:15:20 +00:00
|
|
|
import { IconPencil, IconPlus, IconTrash } from "@tabler/icons-react";
|
2026-01-29 21:30:51 +00:00
|
|
|
import React from "react";
|
2026-01-30 20:58:37 +00:00
|
|
|
import {
|
|
|
|
|
Params,
|
|
|
|
|
useLoaderData,
|
|
|
|
|
useParams,
|
|
|
|
|
useFetcher,
|
|
|
|
|
Link,
|
|
|
|
|
} from "react-router";
|
2026-01-30 19:15:20 +00:00
|
|
|
import { ConfirmDialogButton } from "./ConfirmDialogButton";
|
|
|
|
|
import { NavigateButton } from "./NavigateButton";
|
2026-03-04 21:14:18 +00:00
|
|
|
import { OrderSetProps, OrderSets } from "./OrderSets";
|
2026-01-29 21:30:51 +00:00
|
|
|
|
|
|
|
|
export const subOrderSetsLoader = async ({
|
|
|
|
|
params: { username },
|
|
|
|
|
}: {
|
|
|
|
|
params: Params<string>;
|
2026-03-04 21:14:18 +00:00
|
|
|
}) => fetch(`/api/orders/${username}/sets`).then((response) => response.json());
|
2026-01-29 21:30:51 +00:00
|
|
|
|
|
|
|
|
export const SubOrderSets: React.FC = () => {
|
|
|
|
|
const { username: sub_username } = useParams();
|
2026-03-04 21:14:18 +00:00
|
|
|
const orderSets = useLoaderData<OrderSetProps["orderSets"]>();
|
2026-01-30 19:15:20 +00:00
|
|
|
|
2026-01-29 21:30:51 +00:00
|
|
|
return (
|
|
|
|
|
<Container>
|
2026-03-04 21:14:18 +00:00
|
|
|
<OrderSets
|
|
|
|
|
username={sub_username}
|
|
|
|
|
orderSets={orderSets}
|
|
|
|
|
linkBack={<Link to={`/dashboard/`}>Return to dashboard</Link>}
|
|
|
|
|
/>
|
2026-01-29 21:30:51 +00:00
|
|
|
</Container>
|
|
|
|
|
);
|
|
|
|
|
};
|