Files
gridpilot.gg/apps/website/ui/Select.tsx
2026-01-14 10:51:05 +01:00

40 lines
734 B
TypeScript

import React, { ChangeEvent } from 'react';
interface SelectOption {
value: string;
label: string;
}
interface SelectProps {
id?: string;
'aria-label'?: string;
value?: string;
onChange?: (e: ChangeEvent<HTMLSelectElement>) => void;
options: SelectOption[];
className?: string;
}
export function Select({
id,
'aria-label': ariaLabel,
value,
onChange,
options,
className = '',
}: SelectProps) {
return (
<select
id={id}
aria-label={ariaLabel}
value={value}
onChange={onChange}
className={className}
>
{options.map((option) => (
<option key={option.value} value={option.value}>
{option.label}
</option>
))}
</select>
);
}