diff --git a/src/components/mdx/Codesandbox/Codesandbox.tsx b/src/components/mdx/Codesandbox/Codesandbox.tsx index 30940777..66c45cf0 100644 --- a/src/components/mdx/Codesandbox/Codesandbox.tsx +++ b/src/components/mdx/Codesandbox/Codesandbox.tsx @@ -1,4 +1,4 @@ -import Image from 'next/image' +import { Img } from '@/components/mdx' import cn from '@/lib/cn' @@ -40,36 +40,29 @@ export function Codesandbox({ rel="noreferrer" className="mb-2 block" > - {screenshot_url && ( - {title} - )} + {screenshot_url && {title}} )} {!hideTitle && ( <> -
{title}
-

{description}

-
- {tags.map((tag, i) => ( - - {tag} - - ))} -
+
{title}
+ {description &&

{description}

} + {tags.length > 0 && ( +
+ {tags.map((tag, i) => ( + + {tag} + + ))} +
+ )} )} diff --git a/src/components/mdx/Img/Img.tsx b/src/components/mdx/Img/Img.tsx index db20aa1f..38645e8c 100644 --- a/src/components/mdx/Img/Img.tsx +++ b/src/components/mdx/Img/Img.tsx @@ -38,7 +38,7 @@ export async function Img({ decoding="async" loading="lazy" alt={alt} - className={cn('bg-surface-container inline-block rounded-lg', className)} + className={cn('bg-surface-container rounded-lg', className)} {...dims} {...props} />