fix(ui): restore reset button in node image component

This commit is contained in:
psychedelicious 2023-08-16 11:49:00 +10:00
parent 230131646f
commit 5b1099193d

View File

@ -2,6 +2,7 @@ import { Flex } from '@chakra-ui/react';
import { skipToken } from '@reduxjs/toolkit/dist/query'; import { skipToken } from '@reduxjs/toolkit/dist/query';
import { useAppDispatch } from 'app/store/storeHooks'; import { useAppDispatch } from 'app/store/storeHooks';
import IAIDndImage from 'common/components/IAIDndImage'; import IAIDndImage from 'common/components/IAIDndImage';
import IAIDndImageIcon from 'common/components/IAIDndImageIcon';
import { import {
TypesafeDraggableData, TypesafeDraggableData,
TypesafeDroppableData, TypesafeDroppableData,
@ -12,6 +13,7 @@ import {
ImageInputFieldValue, ImageInputFieldValue,
} from 'features/nodes/types/types'; } from 'features/nodes/types/types';
import { memo, useCallback, useMemo } from 'react'; import { memo, useCallback, useMemo } from 'react';
import { FaUndo } from 'react-icons/fa';
import { useGetImageDTOQuery } from 'services/api/endpoints/images'; import { useGetImageDTOQuery } from 'services/api/endpoints/images';
import { PostUploadAction } from 'services/api/types'; import { PostUploadAction } from 'services/api/types';
import { FieldComponentProps } from './types'; import { FieldComponentProps } from './types';
@ -80,7 +82,13 @@ const ImageInputFieldComponent = (
draggableData={draggableData} draggableData={draggableData}
postUploadAction={postUploadAction} postUploadAction={postUploadAction}
useThumbailFallback useThumbailFallback
/> >
<IAIDndImageIcon
onClick={handleReset}
icon={imageDTO ? <FaUndo /> : undefined}
tooltip="Reset Image"
/>
</IAIDndImage>
</Flex> </Flex>
); );
}; };