import { ReactNode } from "react"; import { faEdit } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { ProjectPermissionCan } from "@app/components/permissions"; import { GenericFieldLabel } from "@app/components/secret-syncs"; import { IconButton } from "@app/components/v2"; import { ProjectPermissionSub } from "@app/context"; import { ProjectPermissionSecretSyncActions } from "@app/context/ProjectPermissionContext/types"; import { APP_CONNECTION_MAP } from "@app/helpers/appConnections"; import { SecretSync, TSecretSync } from "@app/hooks/api/secretSyncs"; import { AwsParameterStoreSyncDestinationSection } from "@app/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/AwsParameterStoreSyncDestinationSection"; import { AwsSecretsManagerSyncDestinationSection } from "@app/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/AwsSecretsManagerSyncDestinationSection"; import { DatabricksSyncDestinationSection } from "@app/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/DatabricksSyncDestinationSection"; import { GitHubSyncDestinationSection } from "@app/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncDestinationSection/GitHubSyncDestinationSection"; import { AzureAppConfigurationSyncDestinationSection } from "./AzureAppConfigurationSyncDestinationSection"; import { AzureKeyVaultSyncDestinationSection } from "./AzureKeyVaultSyncDestinationSection"; import { GcpSyncDestinationSection } from "./GcpSyncDestinationSection"; import { HumanitecSyncDestinationSection } from "./HumanitecSyncDestinationSection"; type Props = { secretSync: TSecretSync; onEditDestination: VoidFunction; }; export const SecretSyncDestinationSection = ({ secretSync, onEditDestination }: Props) => { const { destination, connection } = secretSync; const app = APP_CONNECTION_MAP[connection.app].name; let DestinationComponents: ReactNode; switch (secretSync.destination) { case SecretSync.AWSParameterStore: DestinationComponents = ; break; case SecretSync.AWSSecretsManager: DestinationComponents = ; break; case SecretSync.GitHub: DestinationComponents = ; break; case SecretSync.GCPSecretManager: DestinationComponents = ; break; case SecretSync.AzureKeyVault: DestinationComponents = ; break; case SecretSync.AzureAppConfiguration: DestinationComponents = ( ); break; case SecretSync.Databricks: DestinationComponents = ; break; case SecretSync.Humanitec: DestinationComponents = ; break; default: throw new Error(`Unhandled Destination Section components: ${destination}`); } return (

Destination Configuration

{(isAllowed) => ( )}
{connection.name} {DestinationComponents}
); };