import RoutingC from "@/components/icons/RoutingC";
import TicketD from "@/components/icons/TicketD";
import { Button } from "@mui/material";
import Image from "next/image";
import React from "react";
import ButtonData from "./ButtonData";
import CircularLoading from "@/app/component/loading/Circular";
import TextLoading from "@/app/component/loading/Text";

function DetailSm({ user, loading }) {
  const data = user.turns.done[1];

  return (
    <div className="mt-[20px] block md:hidden">
      <div className="flex items-center justify-start gap-[8px]">
        <CircularLoading width={32} height={32} loading={loading}>
          <Image src={data.image} alt="profile" height={32} width={32} />
        </CircularLoading>
        <div className="flex flex-col justify-center items-start gap-[8px]">
          <TextLoading loading={loading} width={60} height={14}>
            <p className="text-[#616161] text-[14px] font-medium">
              {data.name}
            </p>
          </TextLoading>
          <TextLoading loading={loading} width={70} height={14}>
            <p className="text-[#7E7E7E] text-[14px] font-normal">
              {data.expertise}
            </p>
          </TextLoading>
        </div>
      </div>
      <ul className="flex w-full flex-col items-start justify-start mt-[16px]">
        <li className="flex items-center w-full justify-between">
          <TextLoading loading={loading} width={70} height={16}>
            <p className="text-[#7E7E7E] text-[16px] font-normal">
              تاریخ نوبت:
            </p>
          </TextLoading>
          <TextLoading loading={loading} width={55} height={16}>
            <p className="text-[#525252] text-[16px] font-medium">
              {data.date}
            </p>
          </TextLoading>
        </li>
        <span className="block w-full h-px bg-[#EFEFEF] mt-[12px] mb-[16px]"></span>
        <li className="flex flex-wrap items-center w-full justify-between">
          <TextLoading loading={loading} width={80} height={16}>
            <p className="text-[#7E7E7E] text-[16px] font-normal">ساعت نوبت:</p>
          </TextLoading>
          <TextLoading loading={loading} width={60} height={16}>
            <p className="text-[#525252] text-[16px] font-medium">
              {data.time}
            </p>
          </TextLoading>
        </li>
        <span className="block w-full h-px bg-[#EFEFEF] mt-[12px] mb-[16px]"></span>
        <li className="flex flex-wrap gap-x-[12px] gap-y-[12px] items-center w-full justify-between">
          <TextLoading loading={loading} width={200} height={16}>
            <p className="text-[#7E7E7E] text-[14px] font-normal">
              آدرس:<span className="text-[#616161]">{data.location}</span>
            </p>
          </TextLoading>
          <TextLoading loading={loading} width={130} height={40}>
            <Button
              className="!py-[8px] !border-[#EFEFEF] !px-[12px] !gap-[8px]"
              variant="outlined"
            >
              <RoutingC />
              <p className="text-[#5559CE] text-[14px] font-medium">
                مسیریابی آدرس
              </p>
            </Button>
          </TextLoading>
        </li>
        <TextLoading loading={loading} width={100} height={18}>
          <p className="text-[#7E7E7E] text-[14px] font-normal mt-[12px]">
            تلفن: <span className="text-[#616161]">{data.phone}</span>
          </p>
        </TextLoading>
        <span className="block w-full h-px bg-[#EFEFEF] mt-[12px] mb-[16px]"></span>
        <li className="flex items-center justify-between w-full">
          <TextLoading loading={loading} width={120} height={18}>
            <div className="flex items-center gap-[4px] w-fit">
              <TicketD />
              <p className="text-[#616161] text-[14px] lg:text-[20px] font-medium">
                مبلغ پرداخت شده :{" "}
                <span className="text-[#2F2F2F] text-[14px] lg:text-[20px] font-bold">
                  {data.amount_paid} تومان
                </span>
              </p>
            </div>
          </TextLoading>
          <TextLoading loading={loading} width={60} height={18}>
            <p className="text-[#616161] text-[14px] font-bold">
              {data.amount_paid} تومان
            </p>
          </TextLoading>
        </li>
      </ul>
      <ButtonData loading={loading} />
    </div>
  );
}

export default DetailSm;
