'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Code, Globe, Terminal } from 'lucide-react';
export function CodePreview({ data, variant = 'embed' }) {
    const content = data.content || '';
    const language = data.language || '';
    const sandboxed = data.sandboxed;
    const truncated = content.length > 200 ? content.slice(0, 200) + '…' : content;
    const icon = variant === 'html' ? (_jsx(Globe, { size: 14, className: "text-muted-foreground" })) : variant === 'script' ? (_jsx(Terminal, { size: 14, className: "text-muted-foreground" })) : (_jsx(Code, { size: 14, className: "text-muted-foreground" }));
    return (_jsxs("div", { className: "border-border overflow-hidden rounded-md border", children: [_jsxs("div", { className: "border-border bg-card flex items-center gap-2 border-b px-3 py-2", children: [icon, _jsx("span", { className: "text-muted-foreground text-xs", children: language || variant }), sandboxed && (_jsx("span", { className: "bg-muted text-muted-foreground ml-auto rounded px-1.5 py-0.5 text-xs", children: "sandboxed" }))] }), _jsx("div", { className: "bg-card p-4", children: truncated ? (_jsx("pre", { className: "text-foreground overflow-hidden font-mono text-xs whitespace-pre-wrap", children: truncated })) : (_jsx("p", { className: "text-muted-foreground font-mono text-xs italic", children: "// Code content goes here\u2026" })) })] }));
}
//# sourceMappingURL=CodePreview.js.map