feat: add superadmin plan management module

This commit is contained in:
2026-06-16 18:55:48 +05:30
parent d8587a43d4
commit 6c97f89b30
19 changed files with 1082 additions and 1 deletions

View File

@@ -0,0 +1,47 @@
'use client';
import type { ReactNode } from 'react';
import type { ColumnDef } from '@tanstack/react-table';
import { DataTable } from '@/components/data-table';
import type { Plan } from '@/types';
interface PlanTableProps {
columns: ColumnDef<Plan>[];
plans: Plan[];
isLoading: boolean;
toolbar: ReactNode;
skip: number;
limit: number;
total: number;
onPageChange: (skip: number) => void;
}
export function PlanTable({
columns,
plans,
isLoading,
toolbar,
skip,
limit,
total,
onPageChange,
}: PlanTableProps) {
return (
<DataTable
title="Plans"
columns={columns}
data={plans}
isLoading={isLoading}
toolbar={toolbar}
emptyTitle="No plans found."
pagination={{
skip,
limit,
totalItems: total,
onPageChange,
onLimitChange: () => undefined,
}}
/>
);
}