import { useState } from "react"; import Footer from "./Footer"; import Navbar from "./Navbar"; import { useSelector } from "react-redux"; import profilepic from "../img/samplepic.jpg"; import Addproperty from "./Addproperty"; import UserProperties from "./UserProperties"; // import { fetchUserProperties } from "../redux/features/propertySlice"; import "../dashboard.css"; const Dashboard = () => { // const dispatch = useDispatch(); const { user } = useSelector((state) => ({ ...state.auth })); // const { userProperties} = useSelector((state) => state.property); const [activeTab, setActiveTab] = useState("dashboard"); // Fetch user properties when "Active Properties" tab is selected // useEffect(() => { // if (activeTab === "activeProperties") { // dispatch(fetchUserProperties(user?.result?.userId)); // } // }, [activeTab, dispatch, user?.result?.userId]); const renderTabContent = () => { switch (activeTab) { case "addProperty": return ; case "activeProperties": return

Active Properties

{/* {userProperties.length > 0 ? ( ) : (

No active properties found.

)} */}
; case "closedProperties": return

These are your closed properties.

; default: return (
Bess Wills Bracelet ID: SFG 38393 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Text elit more smtit. Kimto lee.
Bess Wills Bracelet ID: SFG 38393 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Text elit more smtit. Kimto lee.
); } }; return ( <>





{/* Left sidebar */}
ProfileImage
{/* Other Information */}
{/* Main content area */}
{/* Static Dashboard greeting */}
Welcome to{" "} {user.result.title}. {user.result.firstName} {user.result.middleName} {user.result.lastName}
{/* Dynamic content based on the selected tab */}
{renderTabContent()}