// FilamentSelect.js
import PropTypes from 'prop-types'
import config from '../../../config'
import ObjectSelect from './ObjectSelect'

const propertyOrder = ['diameter', 'type', 'vendor.name']

const FilamentSelect = ({ onChange, filter, useFilter, value }) => {
  return (
    <ObjectSelect
      endpoint={`${config.backendUrl}/filaments`}
      propertyOrder={propertyOrder}
      filter={filter}
      useFilter={useFilter}
      value={value}
      onChange={onChange}
      placeholder='Select Filament'
      type={'filament'}
    />
  )
}

FilamentSelect.propTypes = {
  onChange: PropTypes.func,
  value: PropTypes.object,
  filter: PropTypes.object,
  useFilter: PropTypes.bool
}

export default FilamentSelect
