website refactor
This commit is contained in:
40
apps/website/ui/Select.tsx
Normal file
40
apps/website/ui/Select.tsx
Normal file
@@ -0,0 +1,40 @@
|
||||
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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user