mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
24 lines
546 B
TypeScript
24 lines
546 B
TypeScript
"use client";
|
|
|
|
import { removeTodo } from "./actions";
|
|
|
|
export type TodoItem = {
|
|
id: number;
|
|
description: string;
|
|
};
|
|
|
|
export function Todo({ item }: { item: TodoItem }) {
|
|
return (
|
|
<li className="flex items-center justify-between rounded-md border border-gray-100 p-3">
|
|
<div className="flex w-full items-center space-x-3">
|
|
{item.description}
|
|
</div>
|
|
<form action={removeTodo}>
|
|
<button name="id" className="p-1 text-3xl" value={item.id}>
|
|
×
|
|
</button>
|
|
</form>
|
|
</li>
|
|
);
|
|
}
|