MCPcopy Create free account
hub / github.com/TaskingAI/TaskingAI / Retrieval

Function Retrieval

frontend/src/components/retrieval/index.tsx:32–455  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30 Space, Drawer, Popover, Input, Tooltip, Spin, Select, Modal, Button
31} from 'antd';
32function Retrieval() {
33 const { t } = useTranslation();
34 const { retrievalLists } = useSelector((state: any) => state.retrieval);
35 const dispatch = useDispatch();
36 const [isVisible, setIsVisible] = useState(true);
37 const [record, setRecord] = useState<any>({})
38
39 const { modelsTableColumn, collectionTableColumn } = CommendComponent();
40 const { tooltipEditTitle, tooltipRecordTitle, tooltipMoreTitle } = tooltipTitle();
41 // const { tooltipEditTitle, tooltipChunkTitle, tooltipRecordTitle, tooltipMoreTitle } = tooltipTitle();
42 const handleViewCode = () => {
43 setIsVisible(false)
44 setViewCodeOpen(true)
45 }
46 const content = (
47 <div style={{ cursor: 'pointer' }}>
48 <p className={styles['popover-eidt']} onClick={() => handleRecord(record, 'Chunks')}>Chunks</p>
49
50 <p className={styles['popover-eidt']} onClick={handleViewCode}>View code</p>
51 <p className={styles['popover-delete']} onClick={() => handleDelete(record)}>Delete</p>
52
53 </div>
54 );
55 const columns = [...collectionTableColumn]
56 columns.push({
57 title: `${t('projectColumnActions')}`,
58 key: 'action',
59 fixed: 'right',
60 width: 157,
61 render: (_: string, record: object) => (
62 <Space size="middle">
63 <div className='table-edit-icon' onClick={() => handleRecord(record, 'Records')}>
64 <Tooltip placement='bottom' color="#fff" arrow={false} overlayClassName='table-tooltip' title={tooltipRecordTitle}>
65 <RecordIcon />
66 </Tooltip>
67 </div>
68
69 <div onClick={() => handleEdit(record)} className='table-edit-icon'>
70 <Tooltip placement='bottom' title={tooltipEditTitle} color='#fff' arrow={false} overlayClassName='table-tooltip'>
71 <EditIcon/>
72 </Tooltip>
73 </div>
74 <div className='table-edit-icon' onClick={() => setRecord(record)}>
75 {isVisible ? <Tooltip placement='bottom' title={tooltipMoreTitle} color='#fff' arrow={false} overlayClassName='table-tooltip'>
76 <Popover trigger="click" placement='bottom' content={content} arrow={false}>
77 <MoreIcon />
78 </Popover>
79 </Tooltip> : <MoreIcon />}
80 </div>
81 </Space>
82 ),
83 },)
84 const [promptList, setPromptList] = useState([])
85 const [hasMore, setHasMore] = useState(false)
86 const [modelHasMore, setModelHasMore] = useState(false)
87 const [OpenDrawer, setOpenDrawer] = useState(false)
88 const [loading, setLoading] = useState(false);
89 const [viewCodeData, setViewCodeData] = useState('')

Callers

nothing calls this directly

Calls 7

handleRecordFunction · 0.85
handleDeleteFunction · 0.70
handleEditFunction · 0.70
fetchModelsListFunction · 0.70
fetchCodeDataFunction · 0.70
handleRequestFunction · 0.70
fetchDataFunction · 0.70

Tested by

no test coverage detected