diff --git a/src/app/admin/cv/category/list/page.tsx b/src/app/admin/cv/category/list/page.tsx index 99c597f..d48b886 100644 --- a/src/app/admin/cv/category/list/page.tsx +++ b/src/app/admin/cv/category/list/page.tsx @@ -2,19 +2,23 @@ import Link from "next/link"; import { trpc } from "~/app/_trpc/Client"; import { useGSAP } from '@gsap/react' -import { useRef } from "react"; +import { useEffect, useRef } from "react"; import * as Card from '~/components/ui/card' import { useGsapContext } from "~/app/_providers/GsapProvicer"; import { Button } from "~/components/ui/button"; -import { Delete } from 'lucide-react' +import { ChevronsUpDown, Delete } from 'lucide-react' +import UpdateCvEntryForm from "../../entry/[id]/UpdateForm"; +import { CollapsibleContent, CollapsibleTrigger, Collapsible } from "~/components/ui/collapsible"; export default function CvPage() { const cvCategories = trpc.cv.category.list.useQuery(); const gsap = useGsapContext() const container = useRef(null); - const mut = trpc.cv.category.delete.useMutation({onSuccess: () => { - console.log('success') - cvCategories.refetch() - }}) + const mut = trpc.cv.category.delete.useMutation({ + onSuccess: () => { + cvCategories.refetch() + } + }) + useEffect(() => { console.log(cvCategories.data) }, [cvCategories.data]) const deleteCategory = (id: string) => { console.log(`deleting ${id}`) mut.mutate(id) @@ -39,17 +43,32 @@ export default function CvPage() { - Category id : {cat.id}
- Category Position : {cat.layoutPosition}
- { - cat.cvEntry.length > 0 ? ( - <> - {cat.cvEntry.map((entry) => { - {entry.title} - })} - - ) : (<>) - } +
+ Category id : {cat.id} + Category Position : {cat.layoutPosition} +
+ Entries: +
+ { + cat.cvEntry.length > 0 ? ( + <> + {cat.cvEntry.map((entry) => ( + + + + + + + + + ))} + + ) : (<>) + } +
+