import Td from "@/components/Td";
import { type FC, Fragment } from "react";

type Props = {
  tdCount: number;
  trCount?: number;
};

const DefaultTableSkeleton: FC<Props> = ({ tdCount, trCount = 5 }) => {
  return (
    <Fragment>
      {Array.from({ length: trCount }).map((_, rowIndex) => (
        <tr className="w-full h-[64px] md:h-[74px] bg-white border-t border-[#EAEDF5]" key={rowIndex}>
          {Array.from({ length: tdCount }).map((_, colIndex) => (
            <Td key={colIndex}>
              <div className="h-4 w-20 max-w-full rounded bg-gray-200 animate-pulse" />
            </Td>
          ))}
        </tr>
      ))}
    </Fragment>
  );
};

export default DefaultTableSkeleton;
