Skip to content

Commit 0374b8b

Browse files
committed
fix: gender fullform
1 parent e5addc6 commit 0374b8b

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

src/components/columns/UserCol.tsx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
"use client";
22

3-
import { type ColumnDef } from "@tanstack/react-table";
4-
import { Checkbox } from "@/components/ui/checkbox";
53
import { DataTableColumnHeader } from "@/components/table/data-table-column-header";
6-
import { Badge } from "@/components/ui/badge";
7-
import { DataTableRowActions } from "@/components/table/data-table-row-actions";
84
import { type User } from "@/data/schema";
9-
import { banUnban } from "@/api/ban";
10-
import toast from "react-hot-toast";
11-
import { Button } from "../ui/button";
5+
import { type ColumnDef } from "@tanstack/react-table";
126
import BanBtn from "../banButton";
137
import { UserModal } from "../table/user-modal";
148

@@ -72,7 +66,13 @@ const columns: ColumnDef<User>[] = [
7266
header: ({ column }) => (
7367
<DataTableColumnHeader column={column} title="Gender" />
7468
),
75-
cell: ({ row }) => <span>{row.getValue("Gender")}</span>,
69+
cell: ({ row }) => (
70+
<div>
71+
<span>{row.getValue("Gender") === "M" && "Male"}</span>
72+
<span>{row.getValue("Gender") === "F" && "Female"}</span>
73+
<span>{row.getValue("Gender") === "O" && "Other"}</span>
74+
</div>
75+
),
7676
},
7777
{
7878
accessorKey: "RegNo",
@@ -94,17 +94,15 @@ const columns: ColumnDef<User>[] = [
9494
header: ({ column }) => (
9595
<DataTableColumnHeader column={column} title="Banned" />
9696
),
97-
cell: ({ row }) => (
98-
<BanBtn row={row}></BanBtn>
99-
),
97+
cell: ({ row }) => <BanBtn row={row}></BanBtn>,
10098
},
10199
{
102100
accessorKey: "ID",
103101
header: () => <p className="text-center">View</p>,
104102
cell: ({ row }) => {
105103
return (
106104
<div className="flex items-center justify-center">
107-
<UserModal user={row.original}></UserModal>
105+
<UserModal user={row.original}></UserModal>
108106
</div>
109107
);
110108
},

0 commit comments

Comments
 (0)