import { PermissionAction } from '@supabase/shared-types/out/constants' import { useParams } from 'common' import { AlertCircle, ExternalLink, Loader2 } from 'lucide-react' import Link from 'next/link' import type { ReactNode } from 'react' import { Button } from 'ui' import { Input } from 'ui-patterns/DataInputs/Input' import type { projectKeys } from './Connect.types' import { useAsyncCheckPermissions } from '@/hooks/misc/useCheckPermissions' function KeyRow({ label, value }: { label: ReactNode; value: string }) { return (

{label}

) } export function ApiKeysTabContent({ projectKeys }: { projectKeys: projectKeys }) { const { ref: projectRef } = useParams() const { isLoading: isLoadingPermissions, can: canReadAPIKeys } = useAsyncCheckPermissions( PermissionAction.SECRETS_READ, '*' ) if (isLoadingPermissions) { return (

Retrieving API keys

) } if (!canReadAPIKeys) { return (

You don't have permission to view API keys.

) } return (
Anon Key (Legacy) } value={projectKeys.anonKey ?? ''} />

For secret keys, see API settings.

) }