import { useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Card, CardContent } from './Card'; import { Button } from './Button'; interface SpoolWeightUpdateModalProps { isOpen: boolean; filamentName: string; oldWeight: number | null; newWeight: number; onConfirm: (keepExisting: boolean) => void; onClose: () => void; } export function SpoolWeightUpdateModal({ isOpen, filamentName, oldWeight, newWeight, onConfirm, onClose, }: SpoolWeightUpdateModalProps) { const { t } = useTranslation(); const [keepExisting, setKeepExisting] = useState(false); useEffect(() => { if (isOpen) setKeepExisting(false); }, [isOpen]); if (!isOpen) return null; const oldWeightLabel = oldWeight !== null ? `${oldWeight}g` : '—'; const newWeightLabel = `${newWeight}g`; return (
e.stopPropagation()}>

{t('settings.catalog.updateSpoolWeight')}

{filamentName}: {oldWeightLabel} → {newWeightLabel}

); }