'use client';
import { useCanvas } from '@/store/canvas';
interface ArtboardProps {
id: string;
label: string;
x: number;
y: number;
width: number;
height: number;
}
export function Artboard({ id, label, x, y, width, height }: ArtboardProps) {
const { selectedArtboardId, selectArtboard } = useCanvas();
const selected = selectedArtboardId === id;
return (
{ e.stopPropagation(); selectArtboard(id); }}
>
{/* Label */}
{label}
{/* Frame */}
{/* Selection handles */}
{selected && (
<>
>
)}
{/* Per-artboard content */}
);
}
function ArtboardContent({ id }: { id: string }) {
switch (id) {
case 'dashboard-card': return ;
case 'user-profile': return ;
case 'nav-sidebar': return ;
case 'data-table': return ;
default: return ;
}
}
// ── DashboardCard ──────────────────────────────────────────
function DashboardCard() {
return (
Revenue Overview
Live
$12,450
↑ +2.4% vs last month
Q4 2024
MRR
SaaS
);
}
// ── UserProfile ────────────────────────────────────────────
function UserProfile() {
return (
Sarah Chen
Design Engineer
{[['Team', 'Acme Inc'], ['Role', 'Admin'], ['Plan', 'Team']].map(([k, v]) => (
{k}
{v}
))}
);
}
// ── NavSidebar ─────────────────────────────────────────────
function NavSidebar() {
const items = [
{ icon: '⊞', label: 'Dashboard', active: true },
{ icon: '◉', label: 'Origin Graph', active: false },
{ icon: '⬜', label: 'Artboards', active: false },
{ icon: '△', label: 'Diffs', active: false },
{ icon: '🔗', label: 'Integrations',active: false },
];
return (
Originmain
{items.map(({ icon, label, active }) => (
{icon}
{label}
))}
);
}
// ── DataTable ──────────────────────────────────────────────
function DataTable() {
const rows = [
{ name: 'DashboardCard', status: 'Live', nodes: 12, tokens: 8 },
{ name: 'UserProfile', status: 'Draft', nodes: 7, tokens: 3 },
{ name: 'NavSidebar', status: 'Live', nodes: 19, tokens: 11 },
{ name: 'DataTable', status: 'Review', nodes: 24, tokens: 14 },
];
return (
Component Inventory
{['Name', 'Status', 'Nodes', 'Tokens'].map(h => (
{h}
))}
{rows.map((row, i) => (
{row.name}
{row.status}
{row.nodes}
{row.tokens}
))}
);
}
function Placeholder({ label }: { label: string }) {
return (
{label}
);
}
function Handle({ pos }: { pos: React.CSSProperties }) {
return (
);
}
function Tag({ children }: { children: string }) {
return (
{children}
);
}