mirror of
https://github.com/muerwre/markdown-home-tab.git
synced 2025-04-25 08:56:41 +07:00
initial commit
This commit is contained in:
commit
9a4eb6ef58
23 changed files with 2490 additions and 0 deletions
|
@ -0,0 +1,23 @@
|
|||
import { MilkdownProvider } from "@milkdown/react";
|
||||
import { FC } from "react";
|
||||
import { MarkdownEditor } from "../../components/MarkdownEditor";
|
||||
import styles from "./styles.module.scss";
|
||||
import { usePersistedValue } from "./hooks/usePersistedValue";
|
||||
|
||||
interface MarkdownEditorContainerProps {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export const MarkdownEditorContainer: FC<MarkdownEditorContainerProps> = ({
|
||||
id,
|
||||
}) => {
|
||||
const [value, setValue] = usePersistedValue(id);
|
||||
|
||||
return (
|
||||
<div className={styles.editor}>
|
||||
<MilkdownProvider>
|
||||
<MarkdownEditor value={value} onChange={setValue} />
|
||||
</MilkdownProvider>
|
||||
</div>
|
||||
);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue