mirror of
https://github.com/FranP-code/ChatGPT.git
synced 2025-10-13 00:13:25 +00:00
chore: export
This commit is contained in:
5
src/view/model/SyncPrompts/config.tsx
vendored
5
src/view/model/SyncPrompts/config.tsx
vendored
@@ -1,4 +1,4 @@
|
||||
import { Switch, Tag, Tooltip } from 'antd';
|
||||
import { Table, Switch, Tag } from 'antd';
|
||||
|
||||
import { genCmd } from '@/utils';
|
||||
|
||||
@@ -35,13 +35,14 @@ export const syncColumns = () => [
|
||||
<Switch checked={v} onChange={(v) => action.setRecord({ ...row, enable: v }, 'enable')} />
|
||||
),
|
||||
},
|
||||
Table.EXPAND_COLUMN,
|
||||
{
|
||||
title: 'Prompt',
|
||||
dataIndex: 'prompt',
|
||||
key: 'prompt',
|
||||
// width: 300,
|
||||
render: (v: string) => (
|
||||
<Tooltip overlayInnerStyle={{ width: 350 }} title={v}><span className="chat-prompts-val">{v}</span></Tooltip>
|
||||
<span className="chat-prompts-val">{v}</span>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
5
src/view/model/SyncPrompts/index.tsx
vendored
5
src/view/model/SyncPrompts/index.tsx
vendored
@@ -6,7 +6,7 @@ import useInit from '@/hooks/useInit';
|
||||
import useData from '@/hooks/useData';
|
||||
import useColumns from '@/hooks/useColumns';
|
||||
import useChatModel, { useCacheModel } from '@/hooks/useChatModel';
|
||||
import useTable, { TABLE_PAGINATION } from '@/hooks/useTable';
|
||||
import { useTableRowSelection, TABLE_PAGINATION } from '@/hooks/useTable';
|
||||
import { fmtDate, chatRoot } from '@/utils';
|
||||
import { syncColumns } from './config';
|
||||
import './index.scss';
|
||||
@@ -14,7 +14,7 @@ import './index.scss';
|
||||
const promptsURL = 'https://github.com/f/awesome-chatgpt-prompts/blob/main/prompts.csv';
|
||||
|
||||
export default function SyncPrompts() {
|
||||
const { rowSelection, selectedRowIDs } = useTable();
|
||||
const { rowSelection, selectedRowIDs } = useTableRowSelection();
|
||||
const [jsonPath, setJsonPath] = useState('');
|
||||
const { modelJson, modelSet } = useChatModel('sync_prompts');
|
||||
const { modelCacheJson, modelCacheSet } = useCacheModel(jsonPath);
|
||||
@@ -93,6 +93,7 @@ export default function SyncPrompts() {
|
||||
dataSource={opData}
|
||||
rowSelection={rowSelection}
|
||||
pagination={TABLE_PAGINATION}
|
||||
expandable={{expandedRowRender: (record) => <div style={{ padding: 10 }}>{record.prompt}</div>}}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user