update categories,
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import { dayjs } from '@/lib/dayjs';
|
||||
|
||||
import type { CreateForm, LessonCategory } from './type';
|
||||
|
||||
export const defaultLessonCategory: LessonCategory = {
|
||||
isEmpty: false,
|
||||
id: 'default-id',
|
||||
cat_name: 'default-category-name',
|
||||
cat_image_url: undefined,
|
||||
cat_image: undefined,
|
||||
pos: 0,
|
||||
visible: 'hidden',
|
||||
lesson_id: 'default-lesson-id',
|
||||
description: 'default-description',
|
||||
remarks: 'default-remarks',
|
||||
//
|
||||
createdAt: dayjs('2099-01-01').toDate(),
|
||||
//
|
||||
name: '',
|
||||
avatar: '',
|
||||
email: '',
|
||||
phone: '',
|
||||
quota: 0,
|
||||
status: 'NA',
|
||||
};
|
||||
|
||||
export const LessonCategoryCreateFormDefault: CreateForm = {
|
||||
name: '',
|
||||
type: '',
|
||||
pos: 1,
|
||||
visible: 'visible',
|
||||
};
|
||||
|
||||
export const emptyLessonCategory: LessonCategory = {
|
||||
...defaultLessonCategory,
|
||||
isEmpty: true,
|
||||
};
|
@@ -4,8 +4,11 @@ import * as React from 'react';
|
||||
|
||||
import { useSelection } from '@/hooks/use-selection';
|
||||
import type { Selection } from '@/hooks/use-selection';
|
||||
|
||||
import type { LessonCategory } from './type';
|
||||
|
||||
// import type { LessonCategory } from './lesson-categories-table';
|
||||
import type { LessonCategory } from '@/components/dashboard/lesson_category/interfaces';
|
||||
// import type { LessonCategory } from '@/components/dashboard/lesson_category/interfaces';
|
||||
|
||||
function noop(): void {
|
||||
return undefined;
|
||||
|
@@ -26,8 +26,9 @@ import { DataTable } from '@/components/core/data-table';
|
||||
import type { ColumnDef } from '@/components/core/data-table';
|
||||
|
||||
import ConfirmDeleteModal from './confirm-delete-modal';
|
||||
import type { LessonCategory } from './interfaces';
|
||||
// import type { LessonCategory } from './interfaces.1ts';
|
||||
import { useLessonCategoriesSelection } from './lesson-categories-selection-context';
|
||||
import { LessonCategory } from './type';
|
||||
|
||||
function columns(handleDeleteClick: (testId: string) => void): ColumnDef<LessonCategory>[] {
|
||||
return [
|
||||
|
28
002_source/cms/src/components/dashboard/lesson_category/type.d.ts
vendored
Normal file
28
002_source/cms/src/components/dashboard/lesson_category/type.d.ts
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
export interface LessonCategory {
|
||||
isEmpty?: boolean;
|
||||
//
|
||||
id: string;
|
||||
cat_name: string;
|
||||
cat_image_url?: string;
|
||||
cat_image?: string;
|
||||
pos: number;
|
||||
visible: string;
|
||||
lesson_id: string;
|
||||
description: string;
|
||||
remarks: string;
|
||||
//
|
||||
name: string;
|
||||
avatar: string;
|
||||
email: string;
|
||||
phone: string;
|
||||
quota: number;
|
||||
status: 'pending' | 'active' | 'blocked' | 'NA';
|
||||
createdAt: Date;
|
||||
}
|
||||
|
||||
export interface CreateForm {
|
||||
name: string;
|
||||
type: string;
|
||||
pos: number;
|
||||
visible: string;
|
||||
}
|
Reference in New Issue
Block a user