Website : rimsha.abasa.com
backdoor
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
talha_silentcontent
/
src
/
components
/
Articles
/
Filename :
columns.tsx
back
Copy
import { ColumnDef } from "@tanstack/react-table" import Link from "next/link" import { Button } from "../ui/button" // This type is used to define the shape of our data. // You can use a Zod schema here if you want. export type Keywords = { _id: string keyword: string article: string status: "pending" | "processing" | "success" | "failed" } let articleLink: string; export const columns: ColumnDef<Keywords>[] = [ { accessorKey: "_id", header: "ID", cell: ({ row }) => { const sequentialNumber = row.index + 1; let articleId: string = row.getValue("_id"); return <div>{sequentialNumber}</div>; } }, { accessorKey: "keyword", header: "Keyword", }, { accessorKey: "article", header: "Article", }, { accessorKey: "status", header: "Status", cell: ({ row }) => { let articleStatus: string = row.getValue("status"); let color = 'bg-green-500'; if (articleStatus === 'not started'){ color = 'bg-blue-300'; } else if(articleStatus === 'in progress'){ color='bg-orange-400' } return <div className={`${color} py-2 px-1 text-xs text-white text-center rounded-lg`}>{articleStatus}</div>; } }, ]