import { Lightning, Wrench } from '@phosphor-icons/react' import { Badge, ActionButton, Flex, Heading, IconText } from '@/components/atoms' interface ErrorPanelHeaderProps { title: string scanLabel: string scanningLabel: string repairAllLabel: string repairingLabel: string errorCount: number warningCount: number errorLabel: string errorsLabel: string warningLabel: string warningsLabel: string isScanning: boolean isRepairing: boolean onScan: () => void onRepairAll: () => void } export function ErrorPanelHeader({ title, scanLabel, scanningLabel, repairAllLabel, repairingLabel, errorCount, warningCount, errorLabel, errorsLabel, warningLabel, warningsLabel, isScanning, isRepairing, onScan, onRepairAll, }: ErrorPanelHeaderProps) { return (
}> {title} {(errorCount > 0 || warningCount > 0) && ( {errorCount > 0 && ( {errorCount} {errorCount === 1 ? errorLabel : errorsLabel} )} {warningCount > 0 && ( {warningCount} {warningCount === 1 ? warningLabel : warningsLabel} )} )} } label={isScanning ? scanningLabel : scanLabel} onClick={onScan} disabled={isScanning || isRepairing} variant="outline" /> } label={isRepairing ? repairingLabel : repairAllLabel} onClick={onRepairAll} disabled={errorCount + warningCount === 0 || isRepairing || isScanning} variant="default" />
) }