"use client" import { ColumnDef } from "@tanstack/react-table" import { Hero } from "@/types/hero" import { Badge } from "@/components/ui/badge" import { HeroRowActions } from "./hero-row-actions" export const getColumns = (onSuccess: () => void): ColumnDef[] => [ { accessorKey: "image", header: "Görsel", cell: ({ row }) => { const imagePath = row.getValue("image") as string if (!imagePath) return
return (
{/* eslint-disable-next-line @next/next/no-img-element */} {row.original.title}
) }, }, { accessorKey: "title", header: "Başlık", }, { accessorKey: "is_active", header: "Durum", cell: ({ row }) => { const isActive = row.getValue("is_active") as boolean return ( {isActive ? "Aktif" : "Pasif"} ) }, }, { accessorKey: "DeletedAt", header: "Silinme Durumu", cell: ({ row }) => { const deletedAt = row.getValue("DeletedAt") if (deletedAt) { return Silinmiş } return null } }, { id: "actions", cell: ({ row }) => , }, ]