'use client' import { SandpackCodeViewer, SandpackFiles, SandpackProvider } from '@codesandbox/sandpack-react' import { useTheme } from 'next-themes' export const Code = (props: any) => { if (!props.className) { return } const language = props.className.replace('language-', '') return } export function CodeBlock({ code }: { code: SandpackFiles }) { const { theme } = useTheme() const trimmedCode = Object.fromEntries( Object.entries(code).map(([key, value]) => [key, (value as string).trim()]) ) return (
) }