import { ExternalLink, Github } from 'lucide-react' import { SupportCategories } from '@supabase/shared-types/out/constants' import { LOCAL_STORAGE_KEYS } from 'common' import { FeatureBanner } from 'components/ui/FeatureBanner' import { APIKeysData } from 'data/api-keys/api-keys-query' import { Button, Card, CardContent, Separator, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from 'ui' import { SupportLink } from '../Support/SupportLink' import { ApiKeyPill } from './ApiKeyPill' import { CreateNewAPIKeysButton } from './CreateNewAPIKeysButton' import { useApiKeysVisibility } from './hooks/useApiKeysVisibility' // Mock API Keys for demo const mockApiKeys = [ { id: 'mock-id-2', type: 'publishable', api_key: 'sb_publishable_ltaNA7nnVozoSCOcZIjg', name: 'web', }, { id: 'mock-id-3', type: 'publishable', api_key: 'sb_publishable_YpotEpinEWsC2dI7FIKI', name: 'mobile', }, { id: 'mock-id-1', type: 'secret', api_key: 'sb_secret_8I4Se•••••••••••••', name: 'backend_api', }, ] as Extract[] /** * Reusable table illustration component */ export const ApiKeysTableIllustration = () => { return ( Name API Key {mockApiKeys.map((apiKey) => ( {apiKey.name}
))}
) } /** * Reusable illustration with gradient overlay component */ export const ApiKeysIllustrationWithOverlay = () => { return ( <> {/* Gradient overlay - horizontal on desktop, vertical on mobile */}
) } /** * "Coming Soon" banner for users who don't have the feature flag enabled */ export const ApiKeysComingSoonBanner = () => { return ( } bgAlt>

New API keys are coming soon

We're rolling out new API keys to better support your application needs.

) } /** * Create API Keys callout for users who have the feature flag enabled but no keys yet */ export const ApiKeysCreateCallout = () => { const { canInitApiKeys } = useApiKeysVisibility() if (!canInitApiKeys) return null return ( } bgAlt>

Create API keys

Use keys to authenticate requests to your app

) } /** * Feedback banner for users who have API keys and the feature is rolled out to them */ export const ApiKeysFeedbackBanner = () => { const { hasApiKeys } = useApiKeysVisibility() // Don't show anything if not in rollout or if keys don't exist if (!hasApiKeys) return null return (

Your new API keys are here

We've updated our API keys to better support your application needs.{' '} Join the discussion on GitHub

Having trouble with the new API keys?{' '} Contact support

) }