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