'use client'; import { memo } from 'react'; import { Checkbox } from '@/components/ui/checkbox'; import { Button } from '@/components/ui/button'; import { ChevronRight, ChevronDown, Plus, SquarePen, Trash2 } from 'lucide-react'; import type { DepartmentTreeItemProps } from './types'; /** * 트리 행 (재귀 렌더링) * - 무제한 깊이 지원 * - depth에 따른 동적 들여쓰기 */ export const DepartmentTreeItem = memo(function DepartmentTreeItem({ department, depth, expandedIds, selectedIds, onToggleExpand, onToggleSelect, onAdd, onEdit, onDelete }: DepartmentTreeItemProps) { const hasChildren = department.children && department.children.length > 0; const isExpanded = expandedIds.has(department.id); const isSelected = selectedIds.has(department.id); // 들여쓰기 계산 (depth * 24px) const paddingLeft = depth * 24; return ( <> {/* 현재 행 */}