"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/40", muted: "bg-muted/50", accent: "bg-accent/30", primary: "bg-primary/10", 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 !== undefined ? config.showBorder : true; const borderStyle = config.borderStyle || "subtle"; // 커스텀 배경색 처리 const customBgStyle = backgroundColor === "custom" && config.customColor ? { backgroundColor: config.customColor } : {}; // 선택 상태 테두리 처리 (outline 사용하여 크기 영향 없음) const selectionStyle = isDesignMode && isSelected ? { outline: "2px solid #3b82f6", outlineOffset: "0px", // 크기에 영향 없이 딱 맞게 표시 } : {}; return (