import MenuS from "@/components/icons/MenuS";
import ItemSpecialties from "./ItemSpecialties";

function List({ specialties = [], cityName, stateName }) {
  return (
    <div className="bg-[#FAFAFA]">
      <div className="flex items-center justify-center gap-[12px] pt-[24px] mb-[40px]">
        <MenuS />
        <h1 className="text-[#3B3B3B] text-[16px] sm:text-[19px] md:text-[22px] lg:text-[24px] font-bold">
          لیست تخصص ها
        </h1>
      </div>
      {specialties.length === 0 ? (
        <div className="text-center py-10 text-gray-500">
          تخصصی با این عنوان یافت نشد!
        </div>
      ) : (
        <ul
          className="padding-responsive grid grid-cols-2 sm:grid-cols-3 mg:grid-cols-4 lg:grid-cols-6 gap-x-[16px] md:gap-x-[20px] lg:gap-x-[24px] gap-y-[16px] sm:gap-y-[24px] md:gap-y-[32px] lg:gap-y-[40px]"
        >
          {specialties.map((speciality) => (
            <ItemSpecialties
              data={speciality}
              key={speciality.id}
              cityName={cityName}
              stateName={stateName}
            />
          ))}
        </ul>
      )}
    </div>
  );
}

export default List;
