"use client"; import React from "react"; import { LayoutRendererProps } from "../BaseLayoutRenderer"; /** * heroSection 컴포넌트 */ export interface HeroSectionLayoutProps extends LayoutRendererProps { renderer: any; // HeroSectionLayoutRenderer 타입 } export const HeroSectionLayout: React.FC = ({ layout, isDesignMode = false, isSelected = false, onClick, className = "", renderer, ...props }) => { if (!layout.layoutConfig.heroSection) { return (
heroSection 설정이 없습니다.
layoutConfig.heroSection가 필요합니다.
); } const heroSectionConfig = layout.layoutConfig.heroSection; const containerStyle = renderer.getLayoutContainerStyle(); // heroSection 컨테이너 스타일 const heroSectionStyle: React.CSSProperties = { ...containerStyle, // TODO: 레이아웃 전용 스타일 정의 height: "100%", width: "100%", }; // 디자인 모드 스타일 if (isDesignMode) { heroSectionStyle.border = isSelected ? "2px solid #3b82f6" : "1px solid #e2e8f0"; heroSectionStyle.borderRadius = "8px"; } return (
{layout.zones.map((zone: any) => { const zoneChildren = renderer.getZoneChildren(zone.id); // TODO: 존별 스타일 정의 const zoneStyle: React.CSSProperties = { // 레이아웃별 존 스타일 구현 }; return renderer.renderZone(zone, zoneChildren, { style: zoneStyle, className: "hero-section-zone", }); })} {/* 디자인 모드에서 빈 영역 표시 */} {isDesignMode && layout.zones.length === 0 && (
heroSection에 존을 추가하세요
)}
); };