적용 버튼 비활성화 조건 추가

This commit is contained in:
dohyeons 2025-11-12 17:39:03 +09:00
parent 54b7cae218
commit d3b7859668
1 changed files with 15 additions and 1 deletions

View File

@ -566,7 +566,21 @@ export function WidgetConfigSidebar({ element, isOpen, onClose, onApply }: Widge
<Button variant="outline" onClick={onClose} className="h-9 flex-1 text-sm">
</Button>
<Button onClick={handleApply} className="h-9 flex-1 text-sm">
<Button
onClick={handleApply}
className="h-9 flex-1 text-sm"
disabled={
// 다중 데이터 소스 위젯: dataSources가 비어있거나 endpoint가 없으면 비활성화
(element?.subtype === "map-summary-v2" ||
element?.subtype === "chart" ||
element?.subtype === "list-v2" ||
element?.subtype === "custom-metric-v2" ||
element?.subtype === "risk-alert-v2") &&
(!dataSources ||
dataSources.length === 0 ||
dataSources.some(ds => ds.type === "api" && !ds.endpoint))
}
>
</Button>
</div>