Add AccountCreation component and product list functionality; update routing and translations
This commit is contained in:
37
src/components/FormSelect.jsx
Normal file
37
src/components/FormSelect.jsx
Normal file
@@ -0,0 +1,37 @@
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
function FormSelect({ value, onChange, options, className }) {
|
||||
return (
|
||||
<select
|
||||
value={value}
|
||||
className={
|
||||
"w-1/4 h-10 px-2 rounded-full dark:bg-white dark:text-grey border-2 text-grey focus:outline-grey " +
|
||||
className
|
||||
}
|
||||
onChange={onChange}
|
||||
>
|
||||
<option disabled value="">
|
||||
Select
|
||||
</option>
|
||||
{options.map(({ value, label }) => (
|
||||
<option key={value} value={value}>
|
||||
{label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
);
|
||||
}
|
||||
|
||||
FormSelect.propTypes = {
|
||||
value: PropTypes.string.isRequired,
|
||||
onChange: PropTypes.func.isRequired,
|
||||
className: PropTypes.string,
|
||||
options: PropTypes.arrayOf(
|
||||
PropTypes.shape({
|
||||
value: PropTypes.string.isRequired,
|
||||
label: PropTypes.string.isRequired,
|
||||
})
|
||||
).isRequired,
|
||||
};
|
||||
|
||||
export default FormSelect;
|
||||
Reference in New Issue
Block a user