Feat: 프로젝트 폴더 구조 접기, 펴기 동작 변경

This commit is contained in:
jhynsoo 2024-09-24 09:13:17 +09:00
parent dce85f8a01
commit 4489f18584

View File

@ -36,20 +36,19 @@ export default function ProjectDirectoryItem({
<button className="flex items-center">
<ChevronRight
size={16}
className={`stroke-gray-500 transition-transform ${isExpanded ? 'rotate-90' : ''}`}
className={cn('stroke-gray-500 transition-transform', isExpanded ? 'rotate-90' : '')}
/>
</button>
<span className="overflow-hidden text-ellipsis whitespace-nowrap">{item.title}</span>
</div>
{isExpanded && (
<div className="caption flex flex-col">
{
<div className={cn('caption flex flex-col', isExpanded ? '' : 'hidden')}>
{folderData.children.map((item) => (
<ProjectDirectoryItem
key={`${projectId}-${item.title}`}
projectId={projectId}
item={item}
depth={depth + 1}
initialExpanded={true}
/>
))}
{folderData.images.map((item) => (
@ -61,7 +60,7 @@ export default function ProjectDirectoryItem({
/>
))}
</div>
)}
}
</>
);
}