"use client"; import React from "react"; import { cn } from "@/lib/utils"; export interface SectionPaperProps { component?: { id: string; componentConfig?: { backgroundColor?: "default" | "muted" | "accent" | "primary" | "custom"; customColor?: string; showBorder?: boolean; borderStyle?: "none" | "subtle"; padding?: "none" | "sm" | "md" | "lg"; roundedCorners?: "none" | "sm" | "md" | "lg"; shadow?: "none" | "sm" | "md"; }; style?: React.CSSProperties; }; children?: React.ReactNode; className?: string; onClick?: (e?: React.MouseEvent) => void; isSelected?: boolean; isDesignMode?: boolean; } /** * Section Paper 컴포넌트 * 배경색만 있는 미니멀한 그룹화 컨테이너 (색종이 컨셉) */ export function SectionPaperComponent({ component, children, className, onClick, isSelected = false, isDesignMode = false, }: SectionPaperProps) { const config = component?.componentConfig || {}; // 배경색 매핑 const backgroundColorMap = { default: "bg-muted/20", muted: "bg-muted/30", accent: "bg-accent/20", primary: "bg-primary/5", custom: "", }; // 패딩 매핑 const paddingMap = { none: "p-0", sm: "p-3", md: "p-4", lg: "p-6", }; // 둥근 모서리 매핑 const roundedMap = { none: "rounded-none", sm: "rounded-sm", md: "rounded-md", lg: "rounded-lg", }; // 그림자 매핑 const shadowMap = { none: "", sm: "shadow-sm", md: "shadow-md", }; const backgroundColor = config.backgroundColor || "default"; const padding = config.padding || "md"; const rounded = config.roundedCorners || "md"; const shadow = config.shadow || "none"; const showBorder = config.showBorder || false; const borderStyle = config.borderStyle || "subtle"; // 커스텀 배경색 처리 const customBgStyle = backgroundColor === "custom" && config.customColor ? { backgroundColor: config.customColor } : {}; return (
{/* 디자인 모드에서 빈 상태 안내 */} {isDesignMode && !children && (
📄 Section Paper
컴포넌트를 이곳에 배치하세요
)} {/* 자식 컴포넌트들 */} {children}
); }