updat build ok,
This commit is contained in:
@@ -1,4 +1,18 @@
|
||||
import { dayjs } from '@/lib/dayjs';
|
||||
|
||||
export interface LessonCategory {
|
||||
id: string;
|
||||
isEmpty?: boolean;
|
||||
name: string;
|
||||
avatar?: string;
|
||||
email: string;
|
||||
phone?: string;
|
||||
quota: number;
|
||||
status: 'pending' | 'active' | 'blocked' | 'NA';
|
||||
createdAt: Date;
|
||||
}
|
||||
|
||||
export interface DBLessonCategory {
|
||||
id: string;
|
||||
name: string;
|
||||
avatar?: string;
|
||||
@@ -8,3 +22,18 @@ export interface LessonCategory {
|
||||
status: 'pending' | 'active' | 'blocked';
|
||||
createdAt: Date;
|
||||
}
|
||||
|
||||
export const defaultLessonCategory: LessonCategory = {
|
||||
isEmpty: true,
|
||||
id: '',
|
||||
name: '',
|
||||
email: '',
|
||||
quota: -Infinity,
|
||||
status: 'NA',
|
||||
createdAt: dayjs('2099-01-01').toDate(),
|
||||
};
|
||||
|
||||
export const emptyLessonCategory: LessonCategory = {
|
||||
...defaultLessonCategory,
|
||||
isEmpty: true,
|
||||
};
|
||||
|
@@ -20,7 +20,7 @@ import { dayjs } from '@/lib/dayjs';
|
||||
import { DataTable } from '@/components/core/data-table';
|
||||
import type { ColumnDef } from '@/components/core/data-table';
|
||||
|
||||
import { LessonCategory } from './interfaces';
|
||||
import type { LessonCategory } from './interfaces';
|
||||
import { useLessonCategoriesSelection } from './lesson-categories-selection-context';
|
||||
|
||||
const columns = [
|
||||
@@ -73,6 +73,7 @@ const columns = [
|
||||
active: { label: 'Active', icon: <CheckCircleIcon color="var(--mui-palette-success-main)" weight="fill" /> },
|
||||
blocked: { label: 'Blocked', icon: <MinusIcon color="var(--mui-palette-error-main)" /> },
|
||||
pending: { label: 'Pending', icon: <ClockIcon color="var(--mui-palette-warning-main)" weight="fill" /> },
|
||||
NA: { label: 'NA', icon: <ClockIcon color="var(--mui-palette-warning-main)" weight="fill" /> },
|
||||
} as const;
|
||||
const { label, icon } = mapping[row.status] ?? { label: 'Unknown', icon: null };
|
||||
|
||||
|
Reference in New Issue
Block a user