From 99721c30d8215811a268f32a519efb8893a195f4 Mon Sep 17 00:00:00 2001 From: Rapidement Date: Thu, 14 Nov 2024 12:49:38 +0100 Subject: [PATCH] feat(GIST-99): card code preview (#41) --- src/app/(gistLayout)/mygist/page-ui.tsx | 2 +- src/components/ui/card.tsx | 25 +++++++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/app/(gistLayout)/mygist/page-ui.tsx b/src/app/(gistLayout)/mygist/page-ui.tsx index fa72e54..a054d7b 100644 --- a/src/app/(gistLayout)/mygist/page-ui.tsx +++ b/src/app/(gistLayout)/mygist/page-ui.tsx @@ -30,7 +30,7 @@ export default function MyGistsPage({}: MyGistPageProps) {
-
+
diff --git a/src/components/ui/card.tsx b/src/components/ui/card.tsx index b52aed2..798a60c 100644 --- a/src/components/ui/card.tsx +++ b/src/components/ui/card.tsx @@ -12,6 +12,8 @@ import { import { Trash2 } from "lucide-react" import Shortcut from "./shortcut" import { Gist } from "@/types" +import { Codearea } from "../shadcn/codearea" +import { getLanguage } from "@/lib/language" interface CardProps { gist: Gist @@ -20,13 +22,32 @@ interface CardProps { } export default function Card({ gist, href, onDeleteGist }: CardProps) { + const language = getLanguage(gist.name) + return ( - - + + {gist.name} +
+ {gist.code !== "" ? ( + + ) : ( +
+ Gist empty +
+ )} +