import React, { useState, useEffect } from 'react'; interface List { id: string; name: string; description: string; tasks: Array<{ id: string; name: string; status: string; priority: string; assignee: string; due_date: string; tags: string[]; }>; } export default function App() { const [list, setList] = useState(null); const [sortKey, setSortKey] = useState<'name' | 'priority' | 'due_date'>('due_date'); const [loading, setLoading] = useState(true); useEffect(() => { setTimeout(() => { setList({ id: '1', name: 'Sprint 5 - Product Features', description: 'Development tasks for the fifth sprint focused on new product features', tasks: [ { id: 't1', name: 'User authentication', status: 'in progress', priority: 'high', assignee: 'John Doe', due_date: '2024-02-15', tags: ['backend', 'security'] }, { id: 't2', name: 'Payment integration', status: 'open', priority: 'urgent', assignee: 'Jane Smith', due_date: '2024-02-14', tags: ['backend', 'payments'] }, { id: 't3', name: 'Dashboard UI', status: 'in progress', priority: 'medium', assignee: 'Bob Johnson', due_date: '2024-02-18', tags: ['frontend', 'ui'] }, { id: 't4', name: 'API documentation', status: 'open', priority: 'low', assignee: 'Alice Williams', due_date: '2024-02-20', tags: ['docs'] }, { id: 't5', name: 'Database migration', status: 'closed', priority: 'high', assignee: 'John Doe', due_date: '2024-02-12', tags: ['backend', 'database'] }, { id: 't6', name: 'Email notifications', status: 'in progress', priority: 'medium', assignee: 'Jane Smith', due_date: '2024-02-16', tags: ['backend', 'notifications'] }, ] }); setLoading(false); }, 500); }, []); if (loading) return
Loading list...
; if (!list) return
List not found
; const sortedTasks = [...list.tasks].sort((a, b) => { if (sortKey === 'due_date') { return new Date(a.due_date).getTime() - new Date(b.due_date).getTime(); } return a[sortKey] > b[sortKey] ? 1 : -1; }); const statusCounts = list.tasks.reduce((acc, task) => { acc[task.status] = (acc[task.status] || 0) + 1; return acc; }, {} as Record); return (

📋 {list.name}

{list.description}

{list.tasks.length} Total
{statusCounts['open'] || 0} Open
{statusCounts['in progress'] || 0} In Progress
{statusCounts['closed'] || 0} Closed
Task
Status
Priority
Assignee
Due Date
Tags
{sortedTasks.map(task => (
{task.name}
{task.status}
{task.priority}
{task.assignee}
{task.due_date}
{task.tags.map(tag => {tag})}
))}
); }