Change selector to use big buttons

This commit is contained in:
James Brunton 2025-09-08 17:13:09 +01:00
parent 3a20238335
commit d0c59a6ab5

View File

@ -1,5 +1,5 @@
import { useTranslation } from 'react-i18next';
import { Select, Stack, Text } from '@mantine/core';
import { Button, Stack, Text } from '@mantine/core';
import { RedactMode } from '../../../hooks/tools/redact/useRedactParameters';
interface RedactModeSelectorProps {
@ -11,35 +11,36 @@ interface RedactModeSelectorProps {
export default function RedactModeSelector({ mode, onModeChange, disabled }: RedactModeSelectorProps) {
const { t } = useTranslation();
const modeOptions = [
{
value: 'automatic',
label: t('redact.modeSelector.automatic', 'Automatic'),
disabled: false
},
{
value: 'manual',
label: t('redact.modeSelector.manual', 'Manual'),
disabled: true // Disabled until implemented
}
];
return (
<Stack gap="sm">
<Text size="sm" fw={600}>
{t('redact.modeSelector.title', 'Redaction Mode')}
</Text>
<Select
value={mode}
onChange={(value) => {
if (value && value !== 'manual') { // Don't allow manual selection yet
onModeChange(value as RedactMode);
}
}}
<div style={{ display: 'flex', gap: '4px' }}>
<Button
variant={mode === 'automatic' ? 'filled' : 'outline'}
color={mode === 'automatic' ? 'blue' : 'var(--text-muted)'}
onClick={() => onModeChange('automatic')}
disabled={disabled}
data={modeOptions}
/>
style={{ flex: 1, height: 'auto', minHeight: '40px', fontSize: '11px' }}
>
<div style={{ textAlign: 'center', lineHeight: '1.1', fontSize: '11px' }}>
{t('redact.modeSelector.automatic', 'Automatic')}
</div>
</Button>
<Button
variant={mode === 'manual' ? 'filled' : 'outline'}
color={mode === 'manual' ? 'blue' : 'var(--text-muted)'}
onClick={() => onModeChange('manual')}
disabled={disabled || true} // Keep manual disabled until implemented
style={{ flex: 1, height: 'auto', minHeight: '40px', fontSize: '11px' }}
>
<div style={{ textAlign: 'center', lineHeight: '1.1', fontSize: '11px' }}>
{t('redact.modeSelector.manual', 'Manual')}
</div>
</Button>
</div>
</Stack>
);
}