website refactor
This commit is contained in:
@@ -5,13 +5,14 @@ interface SelectOption {
|
||||
label: string;
|
||||
}
|
||||
|
||||
interface SelectProps {
|
||||
interface SelectProps extends React.SelectHTMLAttributes<HTMLSelectElement> {
|
||||
id?: string;
|
||||
'aria-label'?: string;
|
||||
value?: string;
|
||||
onChange?: (e: ChangeEvent<HTMLSelectElement>) => void;
|
||||
options: SelectOption[];
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
}
|
||||
|
||||
export function Select({
|
||||
@@ -21,6 +22,8 @@ export function Select({
|
||||
onChange,
|
||||
options,
|
||||
className = '',
|
||||
style,
|
||||
...props
|
||||
}: SelectProps) {
|
||||
const defaultClasses = 'w-full px-3 py-2 bg-deep-graphite border border-charcoal-outline rounded-lg text-white focus:outline-none focus:border-primary-blue transition-colors';
|
||||
const classes = className ? `${defaultClasses} ${className}` : defaultClasses;
|
||||
@@ -32,6 +35,8 @@ export function Select({
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
className={classes}
|
||||
style={style}
|
||||
{...props}
|
||||
>
|
||||
{options.map((option) => (
|
||||
<option key={option.value} value={option.value}>
|
||||
@@ -40,4 +45,4 @@ export function Select({
|
||||
))}
|
||||
</select>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user