refactor: replace native HTML with design system components (Phase 5)
- EnvironmentSelector: bare <select> -> DS Select - LogTab: raw <table> + <input> + <button> -> DS LogViewer + Input + Button - AppsTab: 3 homegrown sub-tab bars -> DS Tabs, remove unused CSS - AppConfigDetailPage: 4x <select> -> DS Select, 2x <input checkbox> -> DS Toggle, 7x <label> -> DS Label, 4x <button> -> DS Button - AgentHealth: 4x <select> -> DS Select, 7x <button> -> DS Button Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { useMemo } from 'react';
|
||||
import { Select } from '@cameleer/design-system';
|
||||
import styles from './EnvironmentSelector.module.css';
|
||||
|
||||
interface EnvironmentSelectorProps {
|
||||
@@ -9,17 +11,20 @@ interface EnvironmentSelectorProps {
|
||||
export function EnvironmentSelector({ environments, value, onChange }: EnvironmentSelectorProps) {
|
||||
if (environments.length === 0) return null;
|
||||
|
||||
const options = useMemo(
|
||||
() => [
|
||||
{ value: '', label: 'All Envs' },
|
||||
...environments.map((env) => ({ value: env, label: env })),
|
||||
],
|
||||
[environments],
|
||||
);
|
||||
|
||||
return (
|
||||
<select
|
||||
<Select
|
||||
className={styles.select}
|
||||
options={options}
|
||||
value={value ?? ''}
|
||||
onChange={(e) => onChange(e.target.value || undefined)}
|
||||
aria-label="Environment filter"
|
||||
>
|
||||
<option value="">All Envs</option>
|
||||
{environments.map((env) => (
|
||||
<option key={env} value={env}>{env}</option>
|
||||
))}
|
||||
</select>
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user