import {ScrollText, Zap} from 'lucide-react' import type {CloudResource} from '@/types/resource' type LambdaTrigger = {trigger: string; label: string; functionArn: string; functionName: string; version: string | null} export function CognitoTriggersSection({pool}: {pool?: CloudResource}) { const triggers = triggersOf(pool) return <>
Lambda triggers
Functions Cognito runs during sign-up, sign-in and token issueThis pool runs no Lambda triggers.
} {triggers.length > 0 && } > } function triggersOf(pool?: CloudResource): LambdaTrigger[] { const triggers = pool?.metadata.lambdaTriggers if (!Array.isArray(triggers)) return [] return triggers.filter((trigger): trigger is LambdaTrigger => typeof trigger?.functionName === 'string' && typeof trigger?.label === 'string') }