import { connection } from 'next/server'; import { Suspense } from 'react'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { getTodos, getUser } from './api'; export async function UserProfile() { await connection(); try { const user = await getUser(); if (!user) return null; return (
{user.email}
No todos found.
) : ( todos.map((todo: any) => ({todo.title}
{new Date(todo.createdAt).toLocaleDateString()}
Failed to load todos.
; } } export function UserProfileSkeleton() { return (