feat: implement dynamic categories, admin category CRUD, fix routing and cleanup
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
'use client'
|
||||
|
||||
import { deleteNeighborhoodAction } from '@/app/actions'
|
||||
import { Trash } from 'lucide-react'
|
||||
|
||||
export function DeleteButton({ id }: { id: string }) {
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={async () => {
|
||||
if (!confirm('Bu mahalleyi silmek istediğinize emin misiniz?')) return
|
||||
const res = await deleteNeighborhoodAction(id)
|
||||
if (res?.error) {
|
||||
alert(res.error)
|
||||
}
|
||||
}}
|
||||
className="p-2 text-shutter hover:text-red-500 hover:bg-red-500/10 rounded-lg transition-colors"
|
||||
title="Sil"
|
||||
>
|
||||
<Trash className="w-4 h-4" />
|
||||
</button>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user