mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-07-13 00:50:06 +08:00
eb43c8b4f8
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.
44 lines
1.0 KiB
TypeScript
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>
|
|
</>
|
|
);
|
|
};
|