import { MotionButton } from '@/common/components/molecules/MotionButton/MotionButton'; import { useCaseCallToActionLegacyLogic } from '@/lib/blocks/components/CaseCallToActionLegacy/hooks/useCaseCallToActionLegacyLogic/useCaseCallToActionLegacyLogic'; import { DialogClose } from '@radix-ui/react-dialog'; import { Send } from 'lucide-react'; import { ComponentProps, FunctionComponent } from 'react'; import { Button } from '../../../../common/components/atoms/Button/Button'; import { Input } from '../../../../common/components/atoms/Input/Input'; import { Select } from '../../../../common/components/atoms/Select/Select'; import { SelectContent } from '../../../../common/components/atoms/Select/Select.Content'; import { SelectItem } from '../../../../common/components/atoms/Select/Select.Item'; import { SelectTrigger } from '../../../../common/components/atoms/Select/Select.Trigger'; import { SelectValue } from '../../../../common/components/atoms/Select/Select.Value'; import { Dialog } from '../../../../common/components/organisms/Dialog/Dialog'; import { DialogContent } from '../../../../common/components/organisms/Dialog/Dialog.Content'; import { DialogDescription } from '../../../../common/components/organisms/Dialog/Dialog.Description'; import { DialogFooter } from '../../../../common/components/organisms/Dialog/Dialog.Footer'; import { DialogHeader } from '../../../../common/components/organisms/Dialog/Dialog.Header'; import { DialogTitle } from '../../../../common/components/organisms/Dialog/Dialog.Title'; import { DialogTrigger } from '../../../../common/components/organisms/Dialog/Dialog.Trigger'; import { capitalize } from '../../../../common/utils/capitalize/capitalize'; import { ctw } from '../../../../common/utils/ctw/ctw'; import { ICaseCallToActionLegacyProps } from './interfaces'; const motionButtonProps = { exit: { opacity: 0, transition: { duration: 0.2 } }, initial: { y: 10, opacity: 0 }, transition: { type: 'spring', bounce: 0.3 }, animate: { y: 0, opacity: 1, transition: { duration: 0.2 } }, } satisfies ComponentProps; export const CaseCallToActionLegacy: FunctionComponent = ({ value, data, }) => { const { // Callbacks onMutateApproveCase, onMutateRevisionCase, onReasonChange, onCommentChange, // /Callbacks // State reason, comment, reasons, noReasons, isDisabled, isLoadingRevisionCase, reasonWithComment, // /State } = useCaseCallToActionLegacyLogic({ parentWorkflowId: data?.parentWorkflowId, childWorkflowId: data?.childWorkflowId, childWorkflowContextSchema: data?.childWorkflowContextSchema, isKYC: data?.isKYC, }); if (value === 'Re-upload needed') { return ( {value} Ask to re-upload By clicking the button below, an email with a link will be sent to the customer, directing them to re-upload the documents you have marked as “re-upload needed”. The case’s status will then change to “Revisions” until the customer will provide the needed documents and fixes. {!noReasons && (
)}
{ if (noReasons) { onReasonChange(event.target.value); return; } onCommentChange(event.target.value); }} value={noReasons ? reason : comment} id={noReasons ? `reason` : `comment`} />
); } // Approve return ( ); };