gear-orders/flask/vite/src/SubOrderSets.tsx

36 lines
1 KiB
TypeScript
Raw Normal View History

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";
import { OrderSetProps, OrderSets } from "./OrderSets";
2026-01-29 21:30:51 +00:00
export const subOrderSetsLoader = async ({
params: { username },
}: {
params: Params<string>;
}) => 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();
const orderSets = useLoaderData<OrderSetProps["orderSets"]>();
2026-01-30 19:15:20 +00:00
2026-01-29 21:30:51 +00:00
return (
<Container>
<OrderSets
username={sub_username}
orderSets={orderSets}
linkBack={<Link to={`/dashboard/`}>Return to dashboard</Link>}
/>
2026-01-29 21:30:51 +00:00
</Container>
);
};