Files
Open-Assistant/website/src/components/Tasks/UnchangedWarning.tsx
T
Adrian Cowan eb43c8b4f8 website: Add a review step before submitting
to hint to the user that they should reread and check what they have written.

Also show numbers for ranked items rather than drag handles in the review step as the items can't be moved in that step.
2023-01-14 02:16:27 +11:00

44 lines
1.0 KiB
TypeScript

import {
Button,
Flex,
Modal,
ModalBody,
ModalCloseButton,
ModalContent,
ModalFooter,
ModalHeader,
ModalOverlay,
} from "@chakra-ui/react";
interface UnchangedWarningProps {
show: boolean;
title: string;
message: string;
continueButtonText: string;
onClose: () => void;
onContinueAnyway: () => void;
}
export const UnchangedWarning = (props: UnchangedWarningProps) => {
return (
<>
<Modal isOpen={props.show} onClose={props.onClose} isCentered>
<ModalOverlay />
<ModalContent>
<ModalCloseButton />
<ModalHeader>{props.title}</ModalHeader>
<ModalBody>{props.message}</ModalBody>
<ModalFooter>
<Flex justify="center" ml="auto" gap={2}>
<Button variant={"ghost"} onClick={props.onClose}>
Cancel
</Button>
<Button onClick={props.onContinueAnyway}>{props.continueButtonText}</Button>
</Flex>
</ModalFooter>
</ModalContent>
</Modal>
</>
);
};