dodanie nowych komponentow oraz dodanie walidacji propTypes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Jakub Kaniecki
2024-07-08 20:52:43 +02:00
parent 10103fb1a1
commit 256bd8a0ee
31 changed files with 491 additions and 214 deletions

View File

@@ -0,0 +1,35 @@
import propTypes from 'prop-types'
const Selector = (props) => {
return (
<>
<div className='grid grid-cols-2 sm:gap-[1px]'>
<span className='col-span-2 mx-auto text-l font- text-center font-poppins'>{props.name}</span>
{props.value_to_map_from.map((value_to_map_from) => (
<label key={value_to_map_from.id} className
='flex items-center justify-start text-sm font-poppins font-semibold text-gray-600'>
<input type='checkbox' name={props.inputname} value={value_to_map_from.id}
onChange={props.onChange}
className='mr-2'
checked={props.state.includes(value_to_map_from.id)}
/>
{value_to_map_from.name}
</label>
))}
</div>
</>
)
}
Selector.propTypes = {
value_to_map_from: propTypes.array,
setSearchQuery: propTypes.func,
name: propTypes.string,
inputname: propTypes.string,
onChange: propTypes.func,
state: propTypes.array
}
export default Selector