"use client";

import { useState } from "react";

import userData from "@/data/userData.json";
import DashboardPage from "@/components/dashboard";
import UserAccountPage from "./userAccount";

function Content({ matchedCity, params, logged }) {
  const [value, setValue] = useState(Number(params?.sidebar) || 0);
  const [isOpenSide, setIsOpenSide] = useState();
  const [isTurnsDetails, setIsTurnsDetails] = useState(false);

  return (
    <DashboardPage
      value={value}
      logged={logged}
      setValue={setValue}
      user={userData.data}
      isOpenSide={isOpenSide}
      matchedCity={matchedCity}
      setIsOpenSide={setIsOpenSide}
      isTurnsDetails={isTurnsDetails}
      setIsTurnsDetails={setIsTurnsDetails}
    >
      <UserAccountPage
        value={value}
        user={userData.data}
        setIsOpenSide={setIsOpenSide}
        isTurnsDetails={isTurnsDetails}
        setIsTurnsDetails={setIsTurnsDetails}
      />
    </DashboardPage>
  );
}

export default Content;
