feat(ui): add reload schema button (#3252)

This commit is contained in:
blessedcoolant 2023-04-23 19:51:37 +12:00 committed by GitHub
commit d0d8640711
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,9 @@
import { HStack } from '@chakra-ui/react';
import { useAppDispatch } from 'app/storeHooks';
import IAIButton from 'common/components/IAIButton';
import { memo, useCallback } from 'react';
import { Panel } from 'reactflow';
import { receivedOpenAPISchema } from 'services/thunks/schema';
import { nodesGraphBuilt } from 'services/thunks/session';
const TopCenterPanel = () => {
@ -11,11 +13,18 @@ const TopCenterPanel = () => {
dispatch(nodesGraphBuilt());
}, [dispatch]);
const handleReloadSchema = useCallback(() => {
dispatch(receivedOpenAPISchema());
}, [dispatch]);
return (
<Panel position="top-center">
<IAIButton colorScheme="accent" onClick={handleInvoke}>
Will it blend?
</IAIButton>
<HStack>
<IAIButton colorScheme="accent" onClick={handleInvoke}>
Will it blend?
</IAIButton>
<IAIButton onClick={handleReloadSchema}>Reload Schema</IAIButton>
</HStack>
</Panel>
);
};