"use client"; import type { Badge, HotelFeatures, HotelFeaturesType, Tarif, Transport, Type, } from "@/pages/tours/lib/type"; import { Button } from "@/shared/ui/button"; import { type ColumnDef } from "@tanstack/react-table"; import type { Dispatch, SetStateAction } from "react"; import { useTranslation } from "react-i18next"; export const BadgesColumns = ( onEdit: (id: number) => void, onDelete: (id: number) => void, t: (key: string) => string, ): ColumnDef[] => [ { accessorKey: "id", header: "ID", cell: ({ row }) => {row.original.id}, }, { accessorKey: "name", header: t("Nomi"), cell: ({ row }) => {row.original.name}, }, { accessorKey: "color", header: t("Rang"), cell: ({ row }) => (
{row.original.color}
), }, { id: "actions", header: () =>
{t("Harakatlar")}
, cell: ({ row }) => { const { t } = useTranslation(); return (
{" "} {/* o‘ngga tekislangan tugmalar */}
); }, }, ]; export const TarifColumns = ( onEdit: (id: number) => void, onDelete: (id: number) => void, t: (key: string) => string, ): ColumnDef[] => [ { accessorKey: "id", header: "ID", cell: ({ row }) => {row.original.id}, }, { accessorKey: "name", header: t("Nomi"), cell: ({ row }) => {row.original.name}, }, { id: "actions", header: () =>
{t("Harakatlar")}
, cell: ({ row }) => { const { t } = useTranslation(); return (
); }, }, ]; export const TranportColumns = ( onEdit: (id: number) => void, onDelete: (id: number) => void, t: (key: string) => string, ): ColumnDef[] => [ { accessorKey: "id", header: "ID", cell: ({ row }) => {row.original.id}, }, { accessorKey: "name", header: t("Nomi"), cell: ({ row }) => {row.original.name}, }, { id: "actions", header: () =>
{t("Harakatlar")}
, cell: ({ row }) => { const { t } = useTranslation(); return (
); }, }, ]; export const TypeColumns = ( onEdit: (id: number) => void, onDelete: (id: number) => void, t: (key: string) => string, ): ColumnDef[] => [ { accessorKey: "id", header: "ID", cell: ({ row }) => {row.original.id}, }, { accessorKey: "name", header: t("Nomi"), cell: ({ row }) => {row.original.name}, }, { id: "actions", header: () =>
{t("Harakatlar")}
, cell: ({ row }) => { const { t } = useTranslation(); return (
); }, }, ]; export const FeatureColumns = ( onEdit: (id: number) => void, onDelete: (id: number) => void, t: (key: string) => string, setActiveTab: Dispatch>, setFeatureId: Dispatch>, ): ColumnDef[] => [ { accessorKey: "id", header: "ID", cell: ({ row }) => {row.original.id}, }, { accessorKey: "name", header: t("Nomi"), cell: ({ row }) => {row.original.hotel_feature_type_name}, }, { accessorKey: "name", header: () =>
{t("Kategoriya nomi")} (ru)
, cell: ({ row }) => {row.original.hotel_feature_type_name_ru}, }, { id: "actions", header: () =>
{t("Harakatlar")}
, cell: ({ row }) => { const { t } = useTranslation(); return (
); }, }, ]; export const FeatureTypeColumns = ( onEdit: (id: number) => void, onDelete: (id: number) => void, t: (key: string) => string, ): ColumnDef[] => [ { accessorKey: "id", header: "ID", cell: ({ row }) => {row.original.id}, }, { accessorKey: "name", header: t("Nomi"), cell: ({ row }) => {row.original.feature_name}, }, { accessorKey: "name", header: () =>
{t("Kategoriya nomi")}
, cell: ({ row }) => ( {row.original.feature_type.hotel_feature_type_name} ), }, { id: "actions", header: () =>
{t("Harakatlar")}
, cell: ({ row }) => { const { t } = useTranslation(); return (
); }, }, ];