[] => [
{
accessorFn: (row) => row.plan.id,
id: 'id',
meta: { label: 'ID', mobileHidden: true },
header: ({ column }) => (
),
cell: ({ row }) => ,
size: 60,
},
{
accessorFn: (row) => row.plan.title,
id: 'title',
meta: { label: t('Plan'), mobileTitle: true },
header: ({ column }) => (
),
cell: ({ row }) => {
const plan = row.original.plan
return (
{plan.title}
{plan.subtitle && (
{plan.subtitle}
)}
)
},
size: 200,
},
{
accessorFn: (row) => row.plan.price_amount,
id: 'price',
meta: { label: t('Price') },
header: ({ column }) => (
),
cell: ({ row }) => (
${Number(row.original.plan.price_amount || 0).toFixed(2)}
),
size: 100,
},
{
id: 'duration',
meta: { label: t('Validity') },
header: ({ column }) => (
),
cell: ({ row }) => (
{formatDuration(row.original.plan, t)}
),
size: 100,
},
{
id: 'reset',
meta: { label: t('Quota Reset'), mobileHidden: true },
header: ({ column }) => (
),
cell: ({ row }) => (
{formatResetPeriod(row.original.plan, t)}
),
size: 80,
},
{
accessorFn: (row) => row.plan.sort_order,
id: 'sort_order',
meta: { label: t('Priority'), mobileHidden: true },
header: ({ column }) => (
),
cell: ({ row }) => (
{row.original.plan.sort_order}
),
size: 80,
},
{
accessorFn: (row) => row.plan.enabled,
id: 'enabled',
meta: { label: t('Status'), mobileBadge: true },
header: ({ column }) => (
),
cell: ({ row }) =>
row.original.plan.enabled ? (
) : (
),
size: 80,
},
{
id: 'payment',
meta: { label: t('Payment Channel'), mobileHidden: true },
header: ({ column }) => (
),
cell: ({ row }) => {
const plan = row.original.plan
return (
{plan.stripe_price_id && (
)}
{plan.creem_product_id && (
)}
{plan.waffo_pancake_product_id && (
)}
)
},
size: 140,
},
{
id: 'total_amount',
meta: { label: t('Received amount'), mobileHidden: true },
header: ({ column }) => (
),
cell: ({ row }) => {
const total = Number(row.original.plan.total_amount || 0)
return (
{total > 0 ? formatQuota(total) : t('Unlimited')}
)
},
size: 100,
},
{
id: 'upgrade_group',
meta: { label: t('Upgrade Group'), mobileHidden: true },
header: ({ column }) => (
),
cell: ({ row }) => {
const group = row.original.plan.upgrade_group
if (!group) {
return (
{t('No Upgrade')}
)
}
return
},
size: 100,
},
{
id: 'actions',
cell: ({ row }) => ,
size: 80,
},
],
[t]
)
}