import { ReactNode } from "react"; import { faRotate } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { format } from "date-fns"; import { Modal, ModalContent, Spinner } from "@app/components/v2"; import { SECRET_ROTATION_MAP } from "@app/helpers/secretRotationsV2"; import { SecretRotation, TSecretRotationV2, useViewSecretRotationV2GeneratedCredentials } from "@app/hooks/api/secretRotationsV2"; import { ViewSqlRotationGeneratedCredentials } from "./shared"; type Props = { secretRotation?: TSecretRotationV2; isOpen: boolean; onOpenChange: (isOpen: boolean) => void; }; type ContentProps = { secretRotation: TSecretRotationV2; }; const Content = ({ secretRotation }: ContentProps) => { const { id: rotationId, type, nextRotationAt } = secretRotation; const { data: generatedCredentialsResponse, isPending } = useViewSecretRotationV2GeneratedCredentials({ rotationId, type }); if (isPending) { return (
Loading generated credentials...