feat(topics) - add list topic
This commit is contained in:
28
src/features/topics/index.tsx
Normal file
28
src/features/topics/index.tsx
Normal 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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user