import type { BoxProps } from '@mui/material/Box'; import Box from '@mui/material/Box'; import Button from '@mui/material/Button'; import IconButton from '@mui/material/IconButton'; import MenuItem from '@mui/material/MenuItem'; import MenuList from '@mui/material/MenuList'; import Tooltip from '@mui/material/Tooltip'; import { usePopover } from 'minimal-shared/hooks'; import { useTranslation } from 'react-i18next'; import { CustomPopover } from 'src/components/custom-popover'; import { Iconify } from 'src/components/iconify'; import { RouterLink } from 'src/routes/components'; // ---------------------------------------------------------------------- type Props = BoxProps & { backHref: string; editHref: string; liveHref: string; publish: string; onChangePublish: (newValue: string) => void; publishOptions: { value: string; label: string }[]; }; export function ProductDetailsToolbar({ sx, publish, backHref, editHref, liveHref, publishOptions, onChangePublish, ...other }: Props) { const menuActions = usePopover(); const { t } = useTranslation(); const renderMenuActions = () => ( {publishOptions.map((option) => ( { menuActions.onClose(); onChangePublish(option.value); }} > {option.value === 'published' && } {option.value === 'draft' && } {option.label} ))} ); return ( <> {publish === 'published' && ( )} {renderMenuActions()} ); }