chore: path

This commit is contained in:
lencx
2023-01-18 00:03:45 +08:00
parent f38d683f4e
commit a7d12bafc0
16 changed files with 144 additions and 56 deletions

32
src/view/markdown/index.tsx vendored Normal file
View File

@@ -0,0 +1,32 @@
import { useState } from 'react';
import { useLocation } from 'react-router-dom';
import { Breadcrumb } from 'antd';
import { ArrowLeftOutlined } from '@ant-design/icons';
import MarkdownEditor from '@/components/Markdown/Editor';
import useInit from '@/hooks/useInit';
import { getPath } from '@/view/notes/config';
export default function Markdown() {
const [filePath, setFilePath] = useState('');
const location = useLocation();
const state = location?.state;
useInit(async () => {
setFilePath(await getPath(state));
})
return (
<>
<Breadcrumb separator=" ">
<Breadcrumb.Item href="">
<ArrowLeftOutlined />
</Breadcrumb.Item>
<Breadcrumb.Item href="">
{filePath}
</Breadcrumb.Item>
</Breadcrumb>
<MarkdownEditor />
</>
);
}