"use client"; import React from "react"; import { ComponentData } from "@/types/screen"; import { componentRegistry, ComponentRenderer } from "../DynamicComponentRenderer"; import { LayoutGrid } from "lucide-react"; // 대시보드 컴포넌트 렌더러 const DashboardRenderer: ComponentRenderer = ({ component, children, isInteractive = false, ...props }) => { const config = component.componentConfig || {}; const { columns = 3, gap = 16, items = [], style = {} } = config; console.log("📊 DashboardRenderer 렌더링:", { componentId: component.id, isInteractive, config, columns, gap, }); return (
{children && React.Children.count(children) > 0 ? children : // 플레이스홀더 그리드 아이템들 Array.from({ length: columns * 2 }).map((_, index) => (
그리드 {index + 1}
{isInteractive &&
실제 화면
}
))}
); }; // 레지스트리에 등록 componentRegistry.register("dashboard", DashboardRenderer); export { DashboardRenderer };