diff --git a/src/components/action-buttons/approve-button-homologation/index.tsx b/src/components/action-buttons/approve-button-homologation/index.tsx index 359d38d5..fce9b552 100644 --- a/src/components/action-buttons/approve-button-homologation/index.tsx +++ b/src/components/action-buttons/approve-button-homologation/index.tsx @@ -1,11 +1,9 @@ -import { useCallback, useState } from 'react'; -import { FaPlus, FaTrash } from 'react-icons/fa'; +import { useState } from 'react'; +import { FaTrash } from 'react-icons/fa'; import { Box, Button, Flex, - Grid, - Divider, Heading, Popover, PopoverAnchor, @@ -18,16 +16,15 @@ import { Text, useDisclosure, } from '@chakra-ui/react'; -import { Controller, useFieldArray, useForm } from 'react-hook-form'; +import { Controller, useForm } from 'react-hook-form'; import { ActionButtonProps } from '../types'; import { ActionButton } from '..'; import { Input } from '@/components/form-fields/input'; -import { DeleteButton } from '../delete-button'; import { IssuePayloadOpen } from '@/features/issues/types'; import { parseSelectedDatetime } from '@/utils/format-date'; interface ApproveButtonProps extends ActionButtonProps { - handleApproveHomolog: (justify: string) => void; + handleApproveHomolog: (justify: string, dateTime: Date) => void; passDateTime: Date; } @@ -53,22 +50,7 @@ export function ApproveButton({ }, }); - const { fields, append, remove } = useFieldArray({ - control, - shouldUnregister: true, - name: 'problem_types_payload', - }); - - const handleAddDate = useCallback(() => { - append({ label: '', value: '' }); - }, [append]); - - const handleRemoveDate = useCallback( - (index: number) => () => { - remove(index); - }, - [remove] - ); + const dateTime = watch('dateTime'); return ( @@ -84,6 +66,7 @@ export function ApproveButton({ {...props} /> + ({ }) => ( <> ({ )} /> - - - Alertas - - - - {fields?.map((field, index) => { - return ( - - ( - - - - {error ? error.message : null} - - - )} - /> - - - - ); - })} - - - } - variant="outline" - disabled - color="primary" - tooltipProps={{ - placement: 'bottom', - }} - onClick={handleAddDate} - /> - -