import { useState, useEffect } from 'react'; import PageMeta from '../../components/common/PageMeta'; import { useToast } from '../../components/ui/toast/ToastContainer'; import { fetchContent, Content as ContentType } from '../../services/api'; import { Card } from '../../components/ui/card'; export default function Content() { const toast = useToast(); const [content, setContent] = useState([]); const [loading, setLoading] = useState(true); const [selectedContent, setSelectedContent] = useState(null); useEffect(() => { loadContent(); }, []); const loadContent = async () => { try { setLoading(true); const response = await fetchContent(); setContent(response.results || []); } catch (error: any) { toast.error(`Failed to load content: ${error.message}`); } finally { setLoading(false); } }; return (

Content

View all generated content

{loading ? (
Loading...
) : (
{content.map((item: ContentType) => (

Task #{item.task}

Generated: {new Date(item.generated_at).toLocaleString()}

{item.word_count} words
))}
)}
); }