|
@@ -11,6 +11,7 @@ import { LongText } from '@/components/long-text'
|
|
|
import { type User } from '@/types/users.types'
|
|
import { type User } from '@/types/users.types'
|
|
|
|
|
|
|
|
import { DataTableRowActions } from './data-table-row-actions'
|
|
import { DataTableRowActions } from './data-table-row-actions'
|
|
|
|
|
+import { planDurations } from '@/constants/users/users-constants'
|
|
|
|
|
|
|
|
export const usersColumns: ColumnDef<User>[] = [
|
|
export const usersColumns: ColumnDef<User>[] = [
|
|
|
{
|
|
{
|
|
@@ -88,13 +89,27 @@ export const usersColumns: ColumnDef<User>[] = [
|
|
|
cell: ({ row }) => <div dir='ltr'>{row.original.phone}</div>,
|
|
cell: ({ row }) => <div dir='ltr'>{row.original.phone}</div>,
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ // {
|
|
|
|
|
+ // accessorKey: 'email',
|
|
|
|
|
+ // header: ({ column }) => (
|
|
|
|
|
+ // <DataTableColumnHeader column={column} title='ایمیل' />
|
|
|
|
|
+ // ),
|
|
|
|
|
+ // cell: ({ row }) => (
|
|
|
|
|
+ // <div className='text-nowrap'>{row.original.email ?? '-'}</div>
|
|
|
|
|
+ // ),
|
|
|
|
|
+ // },
|
|
|
|
|
+
|
|
|
{
|
|
{
|
|
|
- accessorKey: 'email',
|
|
|
|
|
|
|
+ accessorKey: 'subscription',
|
|
|
header: ({ column }) => (
|
|
header: ({ column }) => (
|
|
|
- <DataTableColumnHeader column={column} title='ایمیل' />
|
|
|
|
|
|
|
+ <DataTableColumnHeader column={column} title='اشتراک' />
|
|
|
),
|
|
),
|
|
|
cell: ({ row }) => (
|
|
cell: ({ row }) => (
|
|
|
- <div className='text-nowrap'>{row.original.email ?? '-'}</div>
|
|
|
|
|
|
|
+ <div className='text-nowrap'>
|
|
|
|
|
+ {row.original.subscription?.plan
|
|
|
|
|
+ ? `${row.original.subscription?.plan?.type} (${planDurations[row.original.subscription?.plan?.duration]})`
|
|
|
|
|
+ : '-'}
|
|
|
|
|
+ </div>
|
|
|
),
|
|
),
|
|
|
},
|
|
},
|
|
|
|
|
|