34 |
35 | {!open && (
36 |
37 |
38 |
39 | )}
40 |
41 |
42 |
64 |
71 |
72 |
73 | }
74 | sx={{ fontWeight: 'fontWeightBold' }}
75 | />
76 |
79 |
80 |
81 |
82 |
83 | );
84 | }
85 |
--------------------------------------------------------------------------------
/src/sections/product/product-sort.tsx:
--------------------------------------------------------------------------------
1 | import type { ButtonProps } from '@mui/material/Button';
2 |
3 | import { useState, useCallback } from 'react';
4 |
5 | import Button from '@mui/material/Button';
6 | import Popover from '@mui/material/Popover';
7 | import MenuList from '@mui/material/MenuList';
8 | import Typography from '@mui/material/Typography';
9 | import MenuItem, { menuItemClasses } from '@mui/material/MenuItem';
10 |
11 | import { Iconify } from 'src/components/iconify';
12 |
13 | // ----------------------------------------------------------------------
14 |
15 | type ProductSortProps = ButtonProps & {
16 | sortBy: string;
17 | onSort: (newSort: string) => void;
18 | options: { value: string; label: string }[];
19 | };
20 |
21 | export function ProductSort({ options, sortBy, onSort, sx, ...other }: ProductSortProps) {
22 | const [openPopover, setOpenPopover] = useState