feat(topics) - add list topic

This commit is contained in:
2026-02-06 15:32:46 +07:00
parent 2ce6a4ab8c
commit 2172614789
15 changed files with 188 additions and 86 deletions

View File

@@ -0,0 +1,28 @@
import { Edit, PlusIcon, Trash2 } from "lucide-react";
import { useTopics } from "./hooks/queries";
export default function TopicsFeature() {
const { data } = useTopics();
return (
<div className="flex flex-col gap-4">
<div className="p-4 flex justify-end">
<button className="shrink-0 px-4 py-2 rounded-md flex items-center justify-center transition-all bg-orange-500 text-white cursor-pointer">
<PlusIcon />
Tambah Topic
</button>
</div>
{data?.map((item, key) => (
<div
key={key}
className="bg-white border-b border-neutral-200 p-4 flex justify-between"
>
<h1>{item.topic}</h1>
<div className="flex gap-2 ">
<Edit className="text-blue-500 cursor-pointer" size={18} />
<Trash2 className="text-red-500 cursor-pointer" size={18} />
</div>
</div>
))}
</div>
);
}