commit cal
This commit is contained in:
parent
408df0d11e
commit
249031619d
|
|
@ -1,13 +1,27 @@
|
|||
|
||||
import { useLocation, useParams } from 'react-router-dom';
|
||||
import { Editor, Tldraw } from "@tldraw/tldraw";
|
||||
import { canvas } from "@/canvas01";
|
||||
import { sharedcalendar2025 } from "@/sharedcalendar2025";
|
||||
|
||||
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 (
|
||||
<div className="tldraw__editor">
|
||||
<Tldraw
|
||||
onMount={(editor: Editor) => {
|
||||
editor.putContentOntoCurrentPage(canvas as any)
|
||||
editor.putContentOntoCurrentPage(getBoard() as any)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue