Spaces:
Running
Running
File size: 519 Bytes
3eae4cc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | import { useState, useEffect } from "react";
import { api } from "./api/client";
import { Dashboard } from "./components/story-ui/Dashboard";
export default function App() {
const [tasks, setTasks] = useState([]);
useEffect(() => {
const boot = async () => {
try {
const taskRes = await api("/tasks");
setTasks(taskRes.tasks || []);
} catch (err) {
console.error("Failed to load tasks", err);
}
};
boot();
}, []);
return <Dashboard tasks={tasks} />;
}
|