"use client"; import React from "react"; import { ComponentRendererProps } from "@/types/component"; import { TextareaBasicConfig } from "./types"; export interface TextareaBasicComponentProps extends ComponentRendererProps { config?: TextareaBasicConfig; } /** * TextareaBasic 컴포넌트 * textarea-basic 컴포넌트입니다 */ export const TextareaBasicComponent: React.FC = ({ component, isDesignMode = false, isSelected = false, isInteractive = false, onClick, onDragStart, onDragEnd, config, className, style, formData, onFormDataChange, ...props }) => { // 컴포넌트 설정 const componentConfig = { ...config, ...component.config, } as TextareaBasicConfig; // 스타일 계산 (위치는 RealtimePreviewDynamic에서 처리하므로 제외) const componentStyle: React.CSSProperties = { width: "100%", height: "100%", ...component.style, ...style, // width는 항상 100%로 고정 (부모 컨테이너가 gridColumns로 크기 제어) width: "100%", }; // 디자인 모드 스타일 if (isDesignMode) { componentStyle.border = "1px dashed #cbd5e1"; componentStyle.borderColor = isSelected ? "#3b82f6" : "#cbd5e1"; } // 이벤트 핸들러 const handleClick = (e: React.MouseEvent) => { e.stopPropagation(); onClick?.(); }; // DOM에 전달하면 안 되는 React-specific props 필터링 - 모든 커스텀 props 제거 // domProps를 사용하지 않고 필요한 props만 명시적으로 전달 return (
{/* 라벨 렌더링 */} {component.label && component.style?.labelDisplay !== false && ( )}