Fix the small mechanical rules. [skip build]
This commit is contained in:
@@ -771,6 +771,42 @@ export function Audio({ requestClose }: AudioProps) {
|
||||
settings.autoGainControl,
|
||||
]);
|
||||
|
||||
let micVariant: 'Critical' | 'Success' | 'Secondary';
|
||||
if (micTestState === 'error') {
|
||||
micVariant = 'Critical';
|
||||
} else if (micTestState === 'done') {
|
||||
micVariant = 'Success';
|
||||
} else {
|
||||
micVariant = 'Secondary';
|
||||
}
|
||||
|
||||
let micLabel = 'Test';
|
||||
if (micTestState === 'testing') {
|
||||
micLabel = 'Testing...';
|
||||
} else if (micTestState === 'done') {
|
||||
micLabel = 'Done ✓';
|
||||
} else if (micTestState === 'error') {
|
||||
micLabel = 'Failed';
|
||||
}
|
||||
|
||||
let speakerVariant: 'Critical' | 'Success' | 'Secondary';
|
||||
if (speakerTestState === 'error') {
|
||||
speakerVariant = 'Critical';
|
||||
} else if (speakerTestState === 'done') {
|
||||
speakerVariant = 'Success';
|
||||
} else {
|
||||
speakerVariant = 'Secondary';
|
||||
}
|
||||
|
||||
let speakerLabel = 'Test';
|
||||
if (speakerTestState === 'testing') {
|
||||
speakerLabel = 'Playing...';
|
||||
} else if (speakerTestState === 'done') {
|
||||
speakerLabel = 'Done ✓';
|
||||
} else if (speakerTestState === 'error') {
|
||||
speakerLabel = 'Failed';
|
||||
}
|
||||
|
||||
return (
|
||||
<Page>
|
||||
<PageHeader>
|
||||
@@ -833,27 +869,13 @@ export function Audio({ requestClose }: AudioProps) {
|
||||
<Box gap="200" alignItems="Center">
|
||||
<Button
|
||||
size="300"
|
||||
variant={
|
||||
micTestState === 'error'
|
||||
? 'Critical'
|
||||
: micTestState === 'done'
|
||||
? 'Success'
|
||||
: 'Secondary'
|
||||
}
|
||||
variant={micVariant}
|
||||
fill="Soft"
|
||||
radii="300"
|
||||
onClick={handleTestMicrophone}
|
||||
disabled={micTestState === 'testing' || micMonitoring}
|
||||
>
|
||||
<Text size="T300">
|
||||
{micTestState === 'testing'
|
||||
? 'Testing...'
|
||||
: micTestState === 'done'
|
||||
? 'Done ✓'
|
||||
: micTestState === 'error'
|
||||
? 'Failed'
|
||||
: 'Test'}
|
||||
</Text>
|
||||
<Text size="T300">{micLabel}</Text>
|
||||
</Button>
|
||||
<Button
|
||||
size="300"
|
||||
@@ -915,27 +937,13 @@ export function Audio({ requestClose }: AudioProps) {
|
||||
/>
|
||||
<Button
|
||||
size="300"
|
||||
variant={
|
||||
speakerTestState === 'error'
|
||||
? 'Critical'
|
||||
: speakerTestState === 'done'
|
||||
? 'Success'
|
||||
: 'Secondary'
|
||||
}
|
||||
variant={speakerVariant}
|
||||
fill="Soft"
|
||||
radii="300"
|
||||
onClick={handleTestSpeaker}
|
||||
disabled={speakerTestState === 'testing'}
|
||||
>
|
||||
<Text size="T300">
|
||||
{speakerTestState === 'testing'
|
||||
? 'Playing...'
|
||||
: speakerTestState === 'done'
|
||||
? 'Done ✓'
|
||||
: speakerTestState === 'error'
|
||||
? 'Failed'
|
||||
: 'Test'}
|
||||
</Text>
|
||||
<Text size="T300">{speakerLabel}</Text>
|
||||
</Button>
|
||||
</Box>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user