My Properties
+My Local Projects
+Get Started
++ Create your first property to start designing +
+diff --git a/apps/editor/app/editor/[propertyId]/page.tsx b/apps/editor/app/editor/[propertyId]/page.tsx new file mode 100644 index 00000000..47954a0a --- /dev/null +++ b/apps/editor/app/editor/[propertyId]/page.tsx @@ -0,0 +1,30 @@ +'use client' + +import Editor from '@/components/editor' +import { useParams } from 'next/navigation' +import { useEffect, useLayoutEffect } from 'react' +import { usePropertyStore } from '@/features/community/lib/properties/store' +import { useAuth } from '@/features/community/lib/auth/hooks' + +export default function EditorPage() { + const params = useParams() + const propertyId = params.propertyId as string + const { isAuthenticated } = useAuth() + const setActiveProperty = usePropertyStore((state) => state.setActiveProperty) + + // Use layoutEffect to set active property BEFORE the editor renders and hooks run + useLayoutEffect(() => { + // For authenticated users with cloud properties, set the active property from URL + if (isAuthenticated && propertyId && !propertyId.startsWith('local_')) { + setActiveProperty(propertyId) + } + }, [propertyId, isAuthenticated, setActiveProperty]) + + return ( +
+ Height from the floor where the ceiling is positioned +
++ Hole {index + 1} {isEditing && '(Editing)'} +
++ {holeArea.toFixed(2)} m² · {hole.length} vertices +
++ No holes. Click "Add Hole" to create one. +
+ )} +Loading...
++ Create your first property to start designing +
++ Saving local property: {localPropertyData.name} +
++ Your building data will be preserved +
+