|
|
@@ -1,11 +1,11 @@
|
|
|
import React, { useState, useEffect } from 'react';
|
|
|
import { templateClient } from '@/client/api';
|
|
|
import { DataTable } from '@/client/admin/components/DataTable';
|
|
|
-import { Button } from '@/client/admin/components/ui/button';
|
|
|
-import { Input } from '@/client/admin/components/ui/input';
|
|
|
-import { Label } from '@/client/admin/components/ui/label';
|
|
|
-import { Textarea } from '@/client/admin/components/ui/textarea';
|
|
|
-import { Badge } from '@/client/admin/components/ui/badge';
|
|
|
+import { Button } from '@/client/components/ui/button';
|
|
|
+import { Input } from '@/client/components/ui/input';
|
|
|
+import { Label } from '@/client/components/ui/label';
|
|
|
+import { Textarea } from '@/client/components/ui/textarea';
|
|
|
+import { Badge } from '@/client/components/ui/badge';
|
|
|
import {
|
|
|
Dialog,
|
|
|
DialogContent,
|
|
|
@@ -13,15 +13,15 @@ import {
|
|
|
DialogHeader,
|
|
|
DialogTitle,
|
|
|
DialogTrigger,
|
|
|
-} from '@/client/admin/components/ui/dialog';
|
|
|
+} from '@/client/components/ui/dialog';
|
|
|
import {
|
|
|
Select,
|
|
|
SelectContent,
|
|
|
SelectItem,
|
|
|
SelectTrigger,
|
|
|
SelectValue,
|
|
|
-} from '@/client/admin/components/ui/select';
|
|
|
-import { Switch } from '@/client/admin/components/ui/switch';
|
|
|
+} from '@/client/components/ui/select';
|
|
|
+import { Switch } from '@/client/components/ui/switch';
|
|
|
import { toast } from 'react-toastify';
|
|
|
import { Plus, Edit, Trash2, Eye, Download } from 'lucide-react';
|
|
|
import { MinioUploader } from '@/client/admin/components/MinioUploader';
|
|
|
@@ -162,14 +162,14 @@ const Templates: React.FC = () => {
|
|
|
{
|
|
|
accessorKey: 'category',
|
|
|
header: '分类',
|
|
|
- cell: ({ row }: any) => (
|
|
|
+ cell: ({ row }) => (
|
|
|
<Badge variant="outline">{row.getValue('category')}</Badge>
|
|
|
),
|
|
|
},
|
|
|
{
|
|
|
accessorKey: 'isFree',
|
|
|
header: '类型',
|
|
|
- cell: ({ row }: any) => (
|
|
|
+ cell: ({ row }) => (
|
|
|
<Badge variant={row.getValue('isFree') ? "default" : "secondary"}>
|
|
|
{row.getValue('isFree') ? '免费' : '会员'}
|
|
|
</Badge>
|
|
|
@@ -182,7 +182,7 @@ const Templates: React.FC = () => {
|
|
|
{
|
|
|
accessorKey: 'isDisabled',
|
|
|
header: '状态',
|
|
|
- cell: ({ row }: any) => (
|
|
|
+ cell: ({ row }) => (
|
|
|
<Badge variant={row.getValue('isDisabled') ? "destructive" : "default"}>
|
|
|
{row.getValue('isDisabled') ? '禁用' : '启用'}
|
|
|
</Badge>
|
|
|
@@ -191,8 +191,8 @@ const Templates: React.FC = () => {
|
|
|
{
|
|
|
id: 'actions',
|
|
|
header: '操作',
|
|
|
- cell: ({ row }: any) => {
|
|
|
- const template = row.original;
|
|
|
+ cell: ({ row }) => {
|
|
|
+ const template = row.original as Template;
|
|
|
return (
|
|
|
<div className="flex gap-2">
|
|
|
<Button
|