mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 13:28:27 +00:00
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
import { Modal, ModalContent } from "@app/components/v2";
|
|
import { useOrganization } from "@app/context";
|
|
import { UsePopUpState } from "@app/hooks/usePopUp";
|
|
import { ShareSecretForm } from "@app/pages/public/ShareSecretPage/components";
|
|
|
|
type Props = {
|
|
popUp: UsePopUpState<["createSharedSecret"]>;
|
|
handlePopUpToggle: (
|
|
popUpName: keyof UsePopUpState<["createSharedSecret"]>,
|
|
state?: boolean
|
|
) => void;
|
|
};
|
|
|
|
export const AddShareSecretModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|
const { currentOrg } = useOrganization();
|
|
return (
|
|
<Modal
|
|
isOpen={popUp?.createSharedSecret?.isOpen}
|
|
onOpenChange={(isOpen) => {
|
|
handlePopUpToggle("createSharedSecret", isOpen);
|
|
}}
|
|
>
|
|
<ModalContent
|
|
title="Share a Secret"
|
|
subTitle="Securely share one off secrets with your team."
|
|
>
|
|
<ShareSecretForm
|
|
isPublic={false}
|
|
value={(popUp.createSharedSecret.data as { value?: string })?.value}
|
|
allowSecretSharingOutsideOrganization={
|
|
currentOrg?.allowSecretSharingOutsideOrganization ?? true
|
|
}
|
|
/>
|
|
</ModalContent>
|
|
</Modal>
|
|
);
|
|
};
|