Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,88 @@ <h2 className="text-xl font-semibold">Task Queue</h2>
]
};

// TodoList Component
function TodoList() {
const [todos, setTodos] = useState([]);
const [inputValue, setInputValue] = useState('');

const addTodo = () => {
if (inputValue.trim() !== '') {
const newTodo = {
id: Date.now(),
text: inputValue.trim(),
completed: false
};
setTodos([...todos, newTodo]);
setInputValue('');
}
};

const toggleTodo = (id) => {
setTodos(todos.map(todo =>
todo.id === id ? { ...todo, completed: !todo.completed } : todo
));
};

const deleteTodo = (id) => {
setTodos(todos.filter(todo => todo.id !== id));
};

const handleKeyPress = (e) => {
if (e.key === 'Enter') {
addTodo();
}
};

return (
<div className="max-w-md mx-auto bg-gray-800 rounded-lg shadow-lg p-6 mb-8">
<h2 className="text-2xl font-bold text-white mb-6 text-center">Todo List</h2>

<div className="flex gap-2 mb-4">
<input
type="text"
value={inputValue}
onChange={(e) => setInputValue(e.target.value)}
onKeyPress={handleKeyPress}
placeholder="Add a new todo..."
className="flex-1 px-4 py-2 bg-gray-700 text-white rounded-lg border border-gray-600 focus:outline-none focus:border-blue-500"
/>
<button
onClick={addTodo}
className="px-6 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500"
>
Add
</button>
</div>

<div className="space-y-2">
{todos.map(todo => (
<div key={todo.id} className="flex items-center gap-3 p-3 bg-gray-700 rounded-lg">
<input
type="checkbox"
checked={todo.completed}
onChange={() => toggleTodo(todo.id)}
className="w-4 h-4 text-blue-600 bg-gray-600 border-gray-500 rounded focus:ring-blue-500"
/>
<span className={`flex-1 ${todo.completed ? 'text-gray-400 line-through' : 'text-white'}`}>
{todo.text}
</span>
<button
onClick={() => deleteTodo(todo.id)}
className="px-3 py-1 bg-red-600 text-white text-sm rounded hover:bg-red-700 focus:outline-none"
>
Delete
</button>
</div>
))}
{todos.length === 0 && (
<p className="text-gray-400 text-center py-4">No todos yet. Add one above!</p>
)}
</div>
</div>
);
}

function App() {
const [state, setState] = useState(initialState);
const [loading, setLoading] = useState(false);
Expand Down Expand Up @@ -3165,6 +3247,9 @@ <h2 className="text-xl font-semibold">Task Queue</h2>
<h1 className="text-4xl font-bold mb-2">🔨 Uncle Frank's Bootstrap Core</h1>
<p className="text-gray-400 mb-8">No BS Autonomous LLM Development Platform</p>

{/* Todo List Component */}
<TodoList />

{/* Task Review Queue */}
<div className="mb-6">
{loadingTasks ? (
Expand Down