import React, { useState } from "react";
import Layout from "../Partials/Layout";
import FamilyManageTabs from "./FamilyManageTabs";
import { useLocation } from "react-router-dom";

export default function FamilyManage() {
  const [selectTab, setValue] = useState("today");

  let location = useLocation();
  let accountDetails = location?.state
  //   tab handler
  const filterHandler = (value) => {
    setValue(value);
  };

  return (
    <Layout>
      {/*<CommonHead />*/}
      <div className="notification-page w-full mb-10">
        <div className="notification-wrapper w-full">
          {/* heading */}
          <div className="sm:flex justify-between items-center mb-6">
            <div className="mb-5 sm:mb-0">
              <h1 className="text-26 font-bold inline-flex gap-3 text-dark-gray dark:text-white items-center">
                <span
                  className={`${selectTab === "today" ? "block" : "hidden"}`}
                >
                  Manage Family
                </span>
              </h1>
            </div>
            <div className="slider-btns flex space-x-4">
              <div
                onClick={() => filterHandler("today")}
                className="relative"
              ></div>
            </div>
          </div>
          <FamilyManageTabs accountDetails={accountDetails} />
        </div>
      </div>
    </Layout>
  );
}