commit cal
This commit is contained in:
parent
77069ce09c
commit
45374928ee
|
|
@ -1,15 +1,29 @@
|
||||||
|
import { useLocation, useParams } from 'react-router-dom';
|
||||||
import { Editor, Tldraw } from "@tldraw/tldraw";
|
import { Editor, Tldraw } from "@tldraw/tldraw";
|
||||||
import { canvas } from "@/canvas01";
|
import { canvas } from "@/canvas01";
|
||||||
|
import { sharedcalendar2025 } from "@/sharedcalendar2025";
|
||||||
|
|
||||||
export function Board() {
|
export function Board() {
|
||||||
|
const { pathname } = useLocation();
|
||||||
|
const boardId = pathname.substring(pathname.lastIndexOf('/') + 1);
|
||||||
|
const getBoard = () => {
|
||||||
|
switch (boardId) {
|
||||||
|
case 'canvas01':
|
||||||
|
return canvas;
|
||||||
|
case 'sharedcalendar2025':
|
||||||
|
return sharedcalendar2025;
|
||||||
|
default:
|
||||||
|
return canvas; // Default to canvas if no match
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="tldraw__editor">
|
<div className="tldraw__editor">
|
||||||
<Tldraw
|
<Tldraw
|
||||||
onMount={(editor: Editor) => {
|
onMount={(editor: Editor) => {
|
||||||
editor.putContentOntoCurrentPage(canvas as any)
|
editor.putContentOntoCurrentPage(getBoard() as any)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue