import { FC, Fragment } from 'react'
import Td from './Td'
import Skeleton from 'react-loading-skeleton'

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 text={''} key={colIndex}>
                                    <Skeleton />
                                </Td>
                            ))
                        }
                    </tr>
                ))
            }
        </Fragment>
    )
}

export default DefaultTableSkeleton
