'use client'; import React from 'react'; import PageTitle from '@/components/ui/PageTitle'; import { EyeOutlined, EditOutlined, SortAscendingOutlined, PlusCircleFilled } from '@ant-design/icons'; import type { Knowledge } from '@/types/knowledge'; import { useRouter } from 'next/navigation'; import { useQuery } from '@tanstack/react-query'; import PrimaryButton from '@/components/ui/PrimaryButton'; import { Flex, Row, Col, Tag, Button, Table, Layout, Image, Typography } from 'antd'; import type { ColumnsType } from 'antd/es/table'; import { getAllKnowledge } from '@/app/api/user/knowledgeService'; import LoadingScreen from '@/components/layout/LoadingScreen'; const { Text, Title } = Typography; const columns: ColumnsType = [ { title: ( Knowledge Source ), dataIndex: 'name', key: 'name' }, { title: ( AI Persona ), dataIndex: 'personas', key: 'personas', render: (_: any, record: Knowledge) => { if (!record.personas?.length) return '-'; return ( {record.personas.map((persona) => ( {persona.name} ))} ); }, }, { title: 'Action', key: 'action', align: 'center' as const, render: (_: any, record: Knowledge) => (