diff --git a/frontend/src/components/whiteboard/sidebar/Sidebar.tsx b/frontend/src/components/whiteboard/sidebar/Sidebar.tsx index c1f012dac..4218a6ac8 100644 --- a/frontend/src/components/whiteboard/sidebar/Sidebar.tsx +++ b/frontend/src/components/whiteboard/sidebar/Sidebar.tsx @@ -1,14 +1,69 @@ 'use client'; -// import TextPropertyBar from '@/components/whiteboard/sidebar/properties/TextPropertyBar'; +import { useState } from 'react'; + +// 패널 컴포넌트들 임포트 +import ShapePanel from '@/components/whiteboard/sidebar/panels/ShapePanel'; + +// TODO: 스토어 훅 임포트 필요 (추후 상태 관리 로직 교체) +// import { useWhiteboardStore } from '@/store/useWhiteboardStore'; + +// 사이드 바 선택된 요소 타입 +type SelectionType = 'shape' | null; export default function Sidebar() { - // TODO : store에서 selectedItemType 가져온 후 조건부 렌더링 + // TODO : 상태 관리 로직 교체 필요 + // 현재 : useState로 로컬 상태 관리 -> 테스트용도 + const [selectionType, setSelectionType] = useState('shape'); + + // 추후 : Store에서 선택된 요소의 데이터 구독하는 방식으로 변경 예정 + // const selectedId = useWhiteboardStore((state) => state.selectedElementId); + // const elements = useWhiteboardStore((state) => state.elements); + // const updateElement = useWhiteboardStore((state) => state.updateElement); + // const selectedElement = selectedId ? elements[selectedId] : null; + // const selectionType = selectedElement ? selectedElement.type : 'none'; + + // TODO : 데이터 매핑 + // const strokeColor = selectedElement?.strokeColor || '#000000'; + // const backgroundColor = selectedElement?.backgroundColor || 'transparent'; + const [strokeColor, setStrokeColor] = useState('#000000'); + const [backgroundColor, setBackgroundColor] = useState('transparent'); + + // 선택 타입에 따른 표시될 헤더 제목 + const getHeaderTitle = () => { + switch (selectionType) { + case 'shape': + return 'Shape'; + default: + return ''; + } + }; return ( -