diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 6e31ac3..eac73ba 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -71,7 +71,9 @@ "title": "ChatGPT", "visible": false, "width": 800, - "height": 600 + "height": 600, + "minWidth": 800, + "minHeight": 600 } ] } diff --git a/src/layout/index.tsx b/src/layout/index.tsx index f6afada..27320b8 100644 --- a/src/layout/index.tsx +++ b/src/layout/index.tsx @@ -1,6 +1,6 @@ import { FC, useState } from 'react'; import { Layout, Menu } from 'antd'; -import { useNavigate } from 'react-router-dom'; +import { useNavigate, useLocation } from 'react-router-dom'; import Routes, { menuItems } from '@/routes'; @@ -14,13 +14,14 @@ interface ChatLayoutProps { const ChatLayout: FC = ({ children }) => { const [collapsed, setCollapsed] = useState(false); + const location = useLocation(); const go = useNavigate(); return ( setCollapsed(value)}>
- go(i.key)} /> + go(i.key)} /> diff --git a/src/routes.tsx b/src/routes.tsx index c885548..3cb0bc7 100644 --- a/src/routes.tsx +++ b/src/routes.tsx @@ -7,7 +7,7 @@ import type { RouteObject } from 'react-router-dom'; import type { MenuProps } from 'antd'; import General from '@view/General'; -import ChatGPTPrompts from '@view/ChatGPTPrompts'; +import ChatGPTPrompts from '@/view/ChatGPTPrompts'; export type ChatRouteObject = { label: string; diff --git a/src/view/ChatGPTPrompts.tsx b/src/view/ChatGPTPrompts.tsx deleted file mode 100644 index 3e4087f..0000000 --- a/src/view/ChatGPTPrompts.tsx +++ /dev/null @@ -1,7 +0,0 @@ -export default function Dashboard() { - return ( -
- TODO: ChatGPT Prompts -
- ) -} \ No newline at end of file diff --git a/src/view/ChatGPTPrompts/config.tsx b/src/view/ChatGPTPrompts/config.tsx new file mode 100644 index 0000000..c6da19c --- /dev/null +++ b/src/view/ChatGPTPrompts/config.tsx @@ -0,0 +1,23 @@ +import { Tag, Tooltip } from 'antd'; + +export const columns = [ + { + title: 'Command', + dataIndex: 'cmd', + key: 'cmd', + }, + { + title: 'Type', + dataIndex: 'type', + key: 'type', + render: (v: string) => {v} + }, + { + title: 'Content', + dataIndex: 'content', + key: 'content', + render: (v: string) => ( + {v} + ), + }, +]; diff --git a/src/view/ChatGPTPrompts/index.scss b/src/view/ChatGPTPrompts/index.scss new file mode 100644 index 0000000..e598926 --- /dev/null +++ b/src/view/ChatGPTPrompts/index.scss @@ -0,0 +1,12 @@ +.chat-prompts-val { + display: inline-block; + width: 100%; + max-width: 300px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.add-btn { + margin-bottom: 20px; +} \ No newline at end of file diff --git a/src/view/ChatGPTPrompts/index.tsx b/src/view/ChatGPTPrompts/index.tsx new file mode 100644 index 0000000..af40ad5 --- /dev/null +++ b/src/view/ChatGPTPrompts/index.tsx @@ -0,0 +1,34 @@ +import { Table, Button } from 'antd'; + +import { columns } from './config'; +import './index.scss'; + +const dataSource = [ + { + cmd: 'terminal', + type: 'dev', + content: 'i want you to act as a linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. do not write explanations. do not type commands unless I instruct you to do so. when i need to tell you something in english, i will do so by putting text inside curly brackets {like this}. my first command is pwd', + }, + { + cmd: 'translator', + type: 'tools', + content: 'I want you to act as an English translator, spelling corrector and improver. I will speak to you in any language and you will detect the language, translate it and answer in the corrected and improved version of my text, in English. I want you to replace my simplified A0-level words and sentences with more beautiful and elegant, upper level English words and sentences. Keep the meaning same, but make them more literary. I want you to only reply the correction, the improvements and nothing else, do not write explanations. My first sentence is "istanbulu cok seviyom burada olmak cok guzel"', + }, +]; + +export default function ChatGPTPrompts() { + return ( +
+ + + + ) +} \ No newline at end of file