import { useFormContext } from "react-hook-form"; import { faEye } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { GenericFieldLabel } from "@app/components/secret-syncs"; import { TSecretSyncForm } from "@app/components/secret-syncs/forms/schemas"; import { Badge, Table, TBody, Td, Th, THead, Tooltip, Tr } from "@app/components/v2"; import { AWS_REGIONS } from "@app/helpers/appConnections"; import { SecretSync } from "@app/hooks/api/secretSyncs"; export const AwsParameterStoreSyncOptionsReviewFields = () => { const { watch } = useFormContext< TSecretSyncForm & { destination: SecretSync.AWSParameterStore } >(); const [{ keyId, tags, syncSecretMetadataAsTags }] = watch(["syncOptions"]); return ( <> {keyId && {keyId}} {tags && tags.length > 0 && ( Key Value {tags.map((tag) => ( {tag.key} {tag.value} ))} } > {tags.length} Tag{tags.length > 1 ? "s" : ""} )} {syncSecretMetadataAsTags && ( Enabled )} > ); }; export const AwsParameterStoreDestinationReviewFields = () => { const { watch } = useFormContext< TSecretSyncForm & { destination: SecretSync.AWSParameterStore } >(); const [{ region, path }] = watch(["destinationConfig"]); const awsRegion = AWS_REGIONS.find((r) => r.slug === region); return ( <> {awsRegion?.name} {awsRegion?.slug}{" "} {path} > ); };