import { useState } from "react" import type { Task } from "./assets/types/task"; function App() { const [tasks, setTasks] = useState([]); const [inputValue, setInputValue] = useState(''); const addTask = () => { if (inputValue.trim() === '') return; const newTask: Task = { id: Date.now(), title: inputValue, completed: false, createdAt: new Date().toISOString() }; setTasks([...tasks, newTask]); setInputValue(''); }; return (

SmartX Task Manager

setInputValue(e.target.value)} />
{tasks.length === 0 ? (

No task found. Lets add!

) : (
    {tasks.map(task => (
  • {task.title}
  • ))}
)}
) } export default App