mirror of
https://github.com/zadam/trilium.git
synced 2025-11-05 04:45:47 +01:00
feat(react/settings): port theme switch
This commit is contained in:
25
apps/client/src/widgets/react/FormSelect.tsx
Normal file
25
apps/client/src/widgets/react/FormSelect.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
interface FormSelectProps {
|
||||
currentValue?: string;
|
||||
onChange(newValue: string): void;
|
||||
values: { val: string, title: string }[];
|
||||
}
|
||||
|
||||
export default function FormSelect({ currentValue, values, onChange }: FormSelectProps) {
|
||||
return (
|
||||
<select
|
||||
class="form-select"
|
||||
onChange={e => onChange((e.target as HTMLInputElement).value)}
|
||||
>
|
||||
{values.map(item => {
|
||||
return (
|
||||
<option
|
||||
value={item.val}
|
||||
selected={item.val === currentValue}
|
||||
>
|
||||
{item.title}
|
||||
</option>
|
||||
);
|
||||
})}
|
||||
</select>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user