import { useState } from "react"; import { Link as RouterLink } from "react-router-dom"; import ScopedCssBaseline from "@mui/material/ScopedCssBaseline"; import Box from "@mui/material/Box"; import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; import { Button, Card, TextField, Select, StatusChip, Tabs, TabPanel, Pagination, CheckboxField, Alert, DataTable, DateField, type DataColumn, PageHeader, EmptyState, LoadingState, FilterBar, StatCard, } from "../ui"; import { useTheme } from "../../context/ThemeContext"; const BoxIcon = ( ); const InboxIcon = ( ); interface DemoRow { id: number; name: string; qty: number; } const DEMO_ROWS: DemoRow[] = [ { id: 1, name: "Beta", qty: 30 }, { id: 2, name: "Alfa", qty: 10 }, { id: 3, name: "Gama", qty: 20 }, ]; function SectionLabel({ children }: { children: React.ReactNode }) { return ( {children} ); } export default function UiKit() { const { theme, toggleTheme } = useTheme(); const [selectVal, setSelectVal] = useState("a"); const [tab, setTab] = useState("one"); const [page, setPage] = useState(2); const [checked, setChecked] = useState(true); const [date, setDate] = useState("2026-06-06"); const [sortBy, setSortBy] = useState("name"); const [sortDir, setSortDir] = useState<"asc" | "desc">("asc"); const [lastClicked, setLastClicked] = useState(null); const onSort = (key: string) => { if (sortBy === key) setSortDir((d) => (d === "asc" ? "desc" : "asc")); else { setSortBy(key); setSortDir("asc"); } }; const sortedRows = [...DEMO_ROWS].sort((a, b) => { const cmp = String(a[sortBy as keyof DemoRow]).localeCompare( String(b[sortBy as keyof DemoRow]), "cs", { numeric: true }, ); return sortDir === "asc" ? cmp : -cmp; }); const columns: DataColumn[] = [ { key: "name", header: "Název", sortKey: "name", render: (r) => r.name }, { key: "qty", header: "Množství", align: "right", mono: true, sortKey: "qty", render: (r) => r.qty, }, ]; return ( UI Kit Faktury 12 vystavených tento měsíc Kit — Phase 3 Select StatCard grid — all colors DataTable — onRowClick + rowDanger (row 2 = danger) {lastClicked && ( Naposledy kliknuto: {lastClicked} )} columns={columns} rows={DEMO_ROWS} rowKey={(r) => r.id} onRowClick={(r) => setLastClicked(r.name)} rowDanger={(r) => r.id === 2} rowInactive={(r) => r.id === 3} /> Button as RouterLink ); }