import { isEmailDeliveryConfigured } from '@admin/actions/email' import { getStorageProvider } from '@admin/actions/storage/provider' export interface IntegrationStatus { id: 'database' | 'storage' | 'email' label: string envName: string docsUrl: string configured: boolean } // The env names are the ones the dashboard's setup card lists; the configured flag comes from the // provider that actually serves the integration. export function getIntegrationStatuses(): IntegrationStatus[] { return [ { id: 'database', label: 'Database', envName: 'DATABASE_URL', docsUrl: 'https://betterstart.dev/docs/setup/database', configured: Boolean(process.env.DATABASE_URL) }, { id: 'storage', label: 'Storage', envName: 'BETTERSTART_R2_BUCKET_NAME', docsUrl: 'https://betterstart.dev/docs/setup/storage', configured: getStorageProvider().isConfigured() }, { id: 'email', label: 'Email', envName: 'BETTERSTART_RESEND_API_KEY', docsUrl: 'https://betterstart.dev/docs/setup/email', configured: isEmailDeliveryConfigured() } ] }