import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from 'ui'
// Demo ErrorCodes component — mirrors the real `` used in
// apps/docs MDX files (e.g. apps/docs/content/guides/auth/debugging/error-codes.mdx).
interface ErrorCodesProps {
service?: string
}
const ERROR_CODES: Record> = {
auth: [
{ code: 'invalid_credentials', description: 'Invalid email or password provided' },
{ code: 'session_not_found', description: 'User session not found or has expired' },
{ code: 'weak_password', description: 'Password does not meet strength requirements' },
{ code: 'email_not_confirmed', description: 'Email address has not been verified' },
{ code: 'mfa_required', description: 'Multi-factor authentication is required' },
],
database: [
{ code: 'connection_timeout', description: 'Database connection timeout after 30 seconds' },
{ code: 'query_failed', description: 'Query execution failed due to syntax error' },
{ code: 'permission_denied', description: 'User does not have permission for this operation' },
{ code: 'row_level_security', description: 'Row-level security policy blocked the request' },
],
realtime: [
{ code: 'SUBSCRIPTION_JOINED', description: 'Client successfully subscribed to a channel' },
{ code: 'SUBSCRIPTION_LEFT', description: 'Client left a subscribed channel' },
{ code: 'MESSAGE_BROADCAST', description: 'Broadcast message received on channel' },
{ code: 'PRESENCE_STATE', description: 'Presence state synchronized' },
],
}
export const ErrorCodes = ({ service = 'auth' }: ErrorCodesProps) => {
const errorCodes = ERROR_CODES[service] || ERROR_CODES.auth
return (
Error Code
Description
{errorCodes.map((item) => (
{item.code}
{item.description}
))}
)
}