You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Sort.tsx 1.1KB

12345678910111213141516171819202122232425262728293031323334
  1. import { FormControl, InputLabel, MenuItem, Select } from '@mui/material';
  2. import { useTranslation } from 'next-i18next';
  3. const Sort = ({ sort, handleSortChange }) => {
  4. const { t } = useTranslation('products');
  5. return (
  6. <>
  7. <FormControl
  8. sx={{
  9. width: '200px',
  10. mb: { xs: '10px', sm: '0px' },
  11. mr: { sm: '10px' },
  12. }}
  13. >
  14. <InputLabel id="sort-label">{t('products:sort')}</InputLabel>
  15. <Select
  16. MenuProps={{
  17. disableScrollLock: true,
  18. }}
  19. label={t('products:sort')}
  20. labelId="sort-label"
  21. id="sort-select-helper"
  22. value={sort}
  23. onChange={handleSortChange}
  24. >
  25. <MenuItem value="asc">{t('products:asc')}</MenuItem>
  26. <MenuItem value="desc">{t('products:desc')}</MenuItem>
  27. </Select>
  28. </FormControl>
  29. </>
  30. );
  31. };
  32. export default Sort;