import { Button, Tooltip, useBreakpointValue } from '@chakra-ui/react'; import { __ } from '@wordpress/i18n'; import React from 'react'; import { UseFormReturn } from 'react-hook-form'; import { deepMerge } from '../../../../../../../assets/js/back-end/utils/utils'; interface Props { methods: UseFormReturn; isLoading: boolean; onSubmit: (arg1: any, arg2?: 'publish' | 'draft') => void; groupStatus?: string; orderInfo?: { id: number; status: string; } | null; } const GroupActionBtn: React.FC = (props) => { const { methods, isLoading, onSubmit, groupStatus, orderInfo } = props; const buttonSize = useBreakpointValue(['sm', 'md']); const isGroupPublished = () => { if (groupStatus && groupStatus === 'publish') { return true; } else { return false; } }; const isGroupDrafted = () => { if (groupStatus && groupStatus === 'draft') { return true; } else { return false; } }; const isOrderIncomplete = () => { return orderInfo && orderInfo.status !== 'completed'; }; const shouldDisablePublish = () => { return isOrderIncomplete() && groupStatus === 'draft'; }; return ( <> ); }; export default GroupActionBtn;