From 56ad5a7868d9b2110cedee9ceab66c22b494a18e Mon Sep 17 00:00:00 2001 From: Antoine BERNIER Date: Fri, 9 Aug 2024 12:33:23 +0200 Subject: [PATCH] Codesandbox[embed] --- src/components/Codesandbox.tsx | 39 ++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/src/components/Codesandbox.tsx b/src/components/Codesandbox.tsx index f8b35b3d..e470e0b1 100644 --- a/src/components/Codesandbox.tsx +++ b/src/components/Codesandbox.tsx @@ -13,6 +13,7 @@ export type CSB = { export default function Codesandbox({ id, data, + embed = false, tags: defaultTags, description: defaultDescription, title: defaultTitle, @@ -20,6 +21,7 @@ export default function Codesandbox({ }: { id: string data: CSB + embed: boolean tags?: string[] description?: string title?: string @@ -31,19 +33,30 @@ export default function Codesandbox({ return ( <> - - {data?.screenshot_url && ( - {title} - )} - + {embed ? ( + + ) : ( + + {data?.screenshot_url && ( + {title} + )} + + )} + {!hideTitle && ( <>
{title}