utkarsh-1602 / ecommerce-admin

This repository provides a comprehensive solution for managing billboards, categories, and products, allowing you to create a customized online shopping experience similar to Shopify. With intuitive features, you can effortlessly design and organize your store as well.
https://ecommerce-admin-mauve-psi.vercel.app
MIT License
2 stars 0 forks source link

what is row.original returning in column.tsx #38

Open utkarsh-1602 opened 11 months ago

utkarsh-1602 commented 11 months ago

Here's what is row.original returning ?


"use client"

import { ColumnDef } from "@tanstack/react-table"

import CellActions from "./cell-action"

export type CategoryColumn = {
    id: string
    name: string
    billboardLabel: string
    createdAt: string
}

export const columns: ColumnDef<CategoryColumn>[] = [
    {
        accessorKey: "name",
        header: "Name",
    },
    {
        accessorKey: "billboard",
        header: "Billboard",
        cell: ({ row }) => row.original.billboardLabel
    },
    {
        accessorKey: "createdAt",
        header: "Date",
    },
    {
        id: "actions",
        cell: ({ row }) => <CellActions data={row.original} />
    }
]