mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 18:41:21 +00:00
feat(ui): allow user to merge secrets while uploading file
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import { Button, Modal, ModalContent } from '../v2';
|
||||
|
||||
type Props = {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
onOverwriteConfirm: (preserve: 'old' | 'new') => void;
|
||||
duplicateKeys: string[];
|
||||
};
|
||||
|
||||
const ConfirmEnvOverwriteModal = ({
|
||||
isOpen,
|
||||
onClose,
|
||||
duplicateKeys,
|
||||
onOverwriteConfirm
|
||||
}: Props): JSX.Element => {
|
||||
return (
|
||||
<Modal isOpen={isOpen}>
|
||||
<ModalContent
|
||||
title="Duplicate Secrets"
|
||||
footerContent={
|
||||
<div className="flex items-center gap-4">
|
||||
<Button colorSchema="primary" onClick={() => onOverwriteConfirm('old')}>
|
||||
Keep Old
|
||||
</Button>
|
||||
<Button colorSchema="danger" onClick={() => onOverwriteConfirm('new')}>
|
||||
Overwrite
|
||||
</Button>
|
||||
</div>
|
||||
}
|
||||
onClose={onClose}
|
||||
>
|
||||
<div className="mx-1 flex flex-col gap-2">
|
||||
<p className='text-gray-400'>File contains following duplicate secrets:</p>
|
||||
<p className="text-sm text-gray-500">{duplicateKeys.join(', ')}</p>
|
||||
<p className='text-md text-gray-400'>Are you sure you want to overwrite these secrets?</p>
|
||||
</div>
|
||||
</ModalContent>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
export default ConfirmEnvOverwriteModal;
|
||||
Reference in New Issue
Block a user