"use client"; import { ActionButtonWithTooltip } from "@/components/ui/action-button"; import { ButtonWithTooltip } from "@/components/ui/button"; import LoadingSpinner from "@/components/ui/spinner"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@/components/ui/table"; import { toast } from "@/components/ui/use-toast"; import { api } from "@/lib/trpc"; import { Check, KeyRound, Pencil, Trash, FilePlus, X } from "lucide-react"; import { useSession } from "next-auth/react"; import AddLabelDialog from "./AddLabelDialog"; export default function LabelsView() { const { data: session } = useSession(); const { data: labels } = api.labels.list.useQuery(); const LabelsTable = ({ labels }) => ( Code Name Description Entries With Label Actions {labels.labels.map((l) => ( {l.code} {l.name} {l.description} {labelStats[l.id].numEntries} deleteLabel({ labelId: l.id })} loading={false} > ))}
); return ( <>
All Labels
{labels === undefined ? ( ) : ( )} ); }