"use client"; import { CopyButton } from "@/components/CopyButton"; import type { StringLiteralUnion } from "shikiji"; import useSWR from "swr"; import { highlight } from "../server/highlight"; export function CodeBlockClient({ code, lang, }: { code: string; lang: StringLiteralUnion; }) { const { data } = useSWR(code, async () => { return highlight(code.trim(), lang); }); return (
{data && (

)}

); }