import { ScaffoldSection, ScaffoldSectionTitle } from 'components/layouts/Scaffold' import { Card, CardContent, CardHeader, CardTitle, Button, AiIconAnimation, Image } from 'ui' import Link from 'next/link' import { BookOpen } from 'lucide-react' import { Logs } from 'icons' import { BASE_PATH } from 'lib/constants' import { useParams } from 'common' import { useAiAssistantStateSnapshot } from 'state/ai-assistant-state' export const OverviewLearnMore = () => { const { ref } = useParams() const aiSnap = useAiAssistantStateSnapshot() const LearnMoreCards = [ { label: 'Docs', title: 'Auth docs', description: 'Read more on Supabase auth, managing users and more.', image: `${BASE_PATH}/img/auth-overview/auth-overview-docs.jpg`, actions: [ { label: 'Docs', href: 'https://supabase.com/docs/guides/auth', icon: , }, ], }, { label: 'Assistant', title: 'Explain auth errors', description: 'Our Assistant can help you debug and fix authentication errors.', image: `${BASE_PATH}/img/auth-overview/auth-overview-assistant.jpg`, actions: [ { label: 'Ask Assistant', onClick: () => { aiSnap.newChat({ name: 'Auth Help', open: true, initialInput: 'Look at my logs related to Supabase Auth and help me debug the recent errors.', suggestions: { title: 'I can help you with authentication issues. Here are some common problems:', prompts: [ { label: 'Login Issues', description: 'Why are users unable to log in to my app?', }, { label: 'JWT Problems', description: 'Help me understand and fix JWT token issues', }, { label: 'RLS Policies', description: 'Explain my Row Level Security policies and fix issues', }, { label: 'Provider Setup', description: 'Help me configure OAuth providers correctly', }, ], }, }) }, icon: , }, ], }, { label: 'Logs', title: 'Dive into the logs', description: 'Auth logs provide a deeper view into your auth requests.', image: `${BASE_PATH}/img/auth-overview/auth-overview-logs.jpg`, actions: [ { label: 'Go to logs', href: `/project/${ref}/logs/auth-logs`, icon: , }, ], }, ] return ( Learn more {LearnMoreCards.map((card) => ( {card.label} {card.title} {card.description} {card.actions.map((action) => { if ('href' in action) { return ( {action.label} ) } else { return ( {action.label} ) } })} ))} ) }
{card.description}