Landlord Operations
{landlordReady ? "Onboarded" : landlordInProgress ? "In Progress" : "Not Set Up"}Manage listings, tenants, lease activity, and incoming payments from a single workflow.
import { useEffect } from "preact/hooks"; import FloatingTileButtons from "./tiles/FloatingTileButtons.tsx"; import type { OnboardingStatus } from "../services/onboardingService.ts"; interface MemberHomeProps { onboardingStatus?: OnboardingStatus | null; /** Server-provided calendar year for hydration-safe initial link (avoids server/client date mismatch). */ serverCalendarYear?: number; /** Server-provided calendar month (1–12) for hydration-safe initial link. */ serverCalendarMonth?: number; } export default function MemberHome( { onboardingStatus, serverCalendarYear, serverCalendarMonth }: MemberHomeProps, ) { useEffect(() => { const lockRoute = localStorage.getItem("lock-route"); if (lockRoute) { localStorage.removeItem("lock-route"); globalThis.location.href = lockRoute; return; } const loginPurpose = localStorage.getItem("login-purpose"); if (loginPurpose) { localStorage.removeItem("login-purpose"); const destination = loginPurpose === "landlord" ? "/landlord/dashboard" : loginPurpose === "tenant" ? "/tenant/dashboard" : ""; if (destination) { globalThis.location.href = destination; } } }, []); const tileIds = [ { id: "landlord-hub", label: "Landlord" }, { id: "tenant-hub", label: "Tenant" }, { id: "admin-center", label: "Admin" }, { id: "user-profile", label: "Profile" }, { id: "dashboard", label: "Dashboard" }, { id: "financial-calendar", label: "Calendar" }, ]; const tenantOnboarded = Boolean(onboardingStatus?.onboarded_tenant); const landlordStep = onboardingStatus?.onboarding_step ?? 0; const landlordStarted = Boolean(onboardingStatus?.onboarded_landlord) || landlordStep > 0; const landlordReady = landlordStarted && landlordStep === 0; const landlordInProgress = landlordStep > 0; const landlordPrimary = landlordReady ? { label: "Open Landlord Dashboard", href: "/landlord/dashboard" } : landlordInProgress ? { label: "Continue Landlord Setup", href: "/landlord/onboarding/profile" } : { label: "Start Landlord Setup", href: "/landlord/onboarding/profile" }; const tenantPrimary = tenantOnboarded ? { label: "Open Tenant Dashboard", href: "/tenant/dashboard" } : { label: "Continue Tenant Setup", href: "/tenant/dashboard" }; const year = serverCalendarYear ?? new Date().getFullYear(); const month = serverCalendarMonth ?? new Date().getMonth() + 1; const calendarHref = `/calendar/financial-calendar/${year}/${ month.toString().padStart(2, "0") }?`; return ( <>
Member Workspace
Open landlord or tenant dashboards quickly, or jump into the financial calendar to plan your monthly budget.
Manage listings, tenants, lease activity, and incoming payments from a single workflow.
Stay on top of rent, maintenance requests, and documents with clear tenant-first workflows.
Administrative controls are available based on your account permissions.
Review account and security preferences.
Track income and obligations by day.