mirror of
https://github.com/FranP-code/ChatGPT.git
synced 2025-10-13 00:13:25 +00:00
chore: add pretty
This commit is contained in:
12
src/view/markdown/index.tsx
vendored
12
src/view/markdown/index.tsx
vendored
@@ -14,7 +14,7 @@ const modeMap: any = {
|
||||
0: 'split',
|
||||
1: 'md',
|
||||
2: 'doc',
|
||||
}
|
||||
};
|
||||
|
||||
export default function Markdown() {
|
||||
const [filePath, setFilePath] = useState('');
|
||||
@@ -26,8 +26,8 @@ export default function Markdown() {
|
||||
useInit(async () => {
|
||||
const file = await getPath(state);
|
||||
setFilePath(file);
|
||||
setSource(await fs.readTextFile(file))
|
||||
})
|
||||
setSource(await fs.readTextFile(file));
|
||||
});
|
||||
|
||||
const handleChange = async (v: string) => {
|
||||
await fs.writeTextFile(filePath, v);
|
||||
@@ -46,9 +46,7 @@ export default function Markdown() {
|
||||
<Breadcrumb.Item onClick={() => history.go(-1)}>
|
||||
<ArrowLeftOutlined />
|
||||
</Breadcrumb.Item>
|
||||
<Breadcrumb.Item onClick={() => shell.open(filePath)}>
|
||||
{filePath}
|
||||
</Breadcrumb.Item>
|
||||
<Breadcrumb.Item onClick={() => shell.open(filePath)}>{filePath}</Breadcrumb.Item>
|
||||
</Breadcrumb>
|
||||
<div>
|
||||
<SplitIcon onClick={handlePreview} style={{ fontSize: 18, color: 'rgba(0,0,0,0.5)' }} />
|
||||
@@ -57,4 +55,4 @@ export default function Markdown() {
|
||||
<MarkdownEditor value={source} onChange={handleChange} mode={modeMap[previewMode]} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user