mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-05-05 07:59:30 -05:00
Added prop types to the dropdown feature.
This commit is contained in:
@@ -42,3 +42,4 @@ function App() {
|
||||
}
|
||||
|
||||
export default App
|
||||
|
||||
|
||||
+12
-1
@@ -1,4 +1,6 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import Autocomplete from '@mui/material/Autocomplete';
|
||||
import TextField from '@mui/material/TextField';
|
||||
|
||||
@@ -7,7 +9,7 @@ const DropDown = ({ id, label, options, onChange, value }) => {
|
||||
<Autocomplete
|
||||
id={id}
|
||||
options={options}
|
||||
getOptionLabel={(option) => option.name} // Assuming each team member object has a 'name' property
|
||||
getOptionLabel={(option) => option.name}
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
renderInput={(params) => <TextField {...params} label={label} />}
|
||||
@@ -15,4 +17,13 @@ const DropDown = ({ id, label, options, onChange, value }) => {
|
||||
);
|
||||
};
|
||||
|
||||
// Define PropTypes for DropDown component
|
||||
DropDown.propTypes = {
|
||||
id: PropTypes.string.isRequired,
|
||||
label: PropTypes.string.isRequired,
|
||||
options: PropTypes.array.isRequired,
|
||||
onChange: PropTypes.func.isRequired,
|
||||
value: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
export default DropDown;
|
||||
|
||||
Reference in New Issue
Block a user