From 4427aa9937fe0fc11183bf5cd02bfdbaa238ab76 Mon Sep 17 00:00:00 2001 From: alma Date: Sun, 20 Apr 2025 15:43:52 +0200 Subject: [PATCH] carnet uix layout --- app/carnet/page.tsx | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/app/carnet/page.tsx b/app/carnet/page.tsx index 830e9346..ecfbe9ad 100644 --- a/app/carnet/page.tsx +++ b/app/carnet/page.tsx @@ -32,6 +32,7 @@ export default function CarnetPage() { const [isMobile, setIsMobile] = useState(false); const [showNav, setShowNav] = useState(true); const [showNotes, setShowNotes] = useState(true); + const [nextcloudFolders, setNextcloudFolders] = useState([]); // Panel widths state const [navWidth, setNavWidth] = useState(220); @@ -43,6 +44,24 @@ export default function CarnetPage() { const isSmallScreen = useMediaQuery("(max-width: 768px)"); const isMediumScreen = useMediaQuery("(max-width: 1024px)"); + useEffect(() => { + const fetchNextcloudFolders = async () => { + try { + const response = await fetch('/api/nextcloud/status'); + if (!response.ok) { + throw new Error('Failed to fetch Nextcloud folders'); + } + const data = await response.json(); + setNextcloudFolders(data.folders || []); + } catch (err) { + console.error('Error fetching Nextcloud folders:', err); + setNextcloudFolders([]); + } + }; + + fetchNextcloudFolders(); + }, []); + useEffect(() => { if (status === "unauthenticated") { redirect("/signin"); @@ -114,7 +133,12 @@ export default function CarnetPage() { className="flex flex-col h-full bg-carnet-sidebar" style={{ width: `${navWidth}px` }} > - + {}} + /> {/* Navigation Resizer */}