diff --git a/frontend/contexts/ReportDesignerContext.tsx b/frontend/contexts/ReportDesignerContext.tsx index 098e419e..a55a1c6d 100644 --- a/frontend/contexts/ReportDesignerContext.tsx +++ b/frontend/contexts/ReportDesignerContext.tsx @@ -285,7 +285,18 @@ export function ReportDesignerProvider({ reportId, children }: { reportId: strin // 복사 (Ctrl+C) const copyComponents = useCallback(() => { if (selectedComponentIds.length > 0) { - const componentsToCopy = components.filter((comp) => selectedComponentIds.includes(comp.id)); + // 잠긴 컴포넌트는 복사에서 제외 + const componentsToCopy = components.filter( + (comp) => selectedComponentIds.includes(comp.id) && !comp.locked + ); + if (componentsToCopy.length === 0) { + toast({ + title: "복사 불가", + description: "잠긴 컴포넌트는 복사할 수 없습니다.", + variant: "destructive", + }); + return; + } setClipboard(componentsToCopy); toast({ title: "복사 완료", @@ -294,6 +305,15 @@ export function ReportDesignerProvider({ reportId, children }: { reportId: strin } else if (selectedComponentId) { const componentToCopy = components.find((comp) => comp.id === selectedComponentId); if (componentToCopy) { + // 잠긴 컴포넌트는 복사 불가 + if (componentToCopy.locked) { + toast({ + title: "복사 불가", + description: "잠긴 컴포넌트는 복사할 수 없습니다.", + variant: "destructive", + }); + return; + } setClipboard([componentToCopy]); toast({ title: "복사 완료",