import { useParams } from 'common' import { ScaffoldSectionTitle } from 'components/layouts/Scaffold' import { ResourceItem } from 'components/ui/Resource/ResourceItem' import { ResourceList } from 'components/ui/Resource/ResourceList' import { useSendEventMutation } from 'data/telemetry/send-event-mutation' import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization' import { Code, Terminal } from 'lucide-react' import Link from 'next/link' import { useRouter } from 'next/router' import { useAiAssistantStateSnapshot } from 'state/ai-assistant-state' import { AiIconAnimation, Button, Card, CardContent, CardHeader, CardTitle, Dialog, DialogContent, DialogSection, DialogTrigger, } from 'ui' import { EDGE_FUNCTION_TEMPLATES } from './Functions.templates' import { TerminalInstructions } from './TerminalInstructions' export const FunctionsEmptyState = () => { const { ref } = useParams() const router = useRouter() const aiSnap = useAiAssistantStateSnapshot() const { mutate: sendEvent } = useSendEventMutation() const org = useSelectedOrganization() return ( <> Create your first edge function {/* Editor Option */}

Via Editor

Create and edit functions directly in the browser. Download to local at any time.

{/* AI Assistant Option */}

AI Assistant

Let our AI assistant help you create functions. Perfect for kickstarting a function.

{/* CLI Option */}

Via CLI

Create and deploy functions using the Supabase CLI. Ideal for local development and version control.

Start with a template {EDGE_FUNCTION_TEMPLATES.map((template) => ( } onClick={() => { sendEvent({ action: 'edge_function_template_clicked', properties: { templateName: template.name, origin: 'functions_page' }, groups: { project: ref ?? 'Unknown', organization: org?.slug ?? 'Unknown' }, }) }} >

{template.name}

{template.description}

))}
) }