Update select props

This commit is contained in:
Hazem Krimi
2021-04-22 00:00:20 +01:00
parent f4733e225a
commit 82669be2f2
+3 -1
View File
@@ -17,6 +17,7 @@ type SelectProps = {
errorMessage?: string; errorMessage?: string;
options: Array<{ value: any; label: string }>; options: Array<{ value: any; label: string }>;
value: string; value: string;
name: string;
label?: string; label?: string;
fullWidth?: boolean; fullWidth?: boolean;
onChange: (event: React.ChangeEvent<HTMLSelectElement>) => void; onChange: (event: React.ChangeEvent<HTMLSelectElement>) => void;
@@ -25,6 +26,7 @@ type SelectProps = {
const Select = ({ const Select = ({
color = 'client', color = 'client',
label, label,
name,
value, value,
options, options,
onChange, onChange,
@@ -47,7 +49,7 @@ const Select = ({
)} )}
</div> </div>
<div className='select'> <div className='select'>
<select value={value} onChange={onChange}> <select value={value} name={name} onChange={onChange}>
{options.map((option) => ( {options.map((option) => (
<option value={option.value}>{option.label}</option> <option value={option.value}>{option.label}</option>
))} ))}