import { useState } from "react";
import Head from "./Head";
import List from "./List";

function Turns({ user, setIsTurnsDetails, loading }) {
  const [isDone, setIsDone] = useState(true);

  return (
    <div className="opacity-page">
      <p className="text-[#3B3B3B] hidden md:flex text-[16px] font-bold">
        تاریخچه نوبت ها
      </p>
      <Head isDone={isDone} setIsDone={setIsDone} />
      <List
        loading={loading}
        setIsTurnsDetails={setIsTurnsDetails}
        user={user.turns[isDone ? "done" : "current"]}
      />
    </div>
  );
}

export default Turns;
