This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Loading({ item = 4 }) { | |
let skeleton = []; | |
for (let i = 0; i < item; i++) { | |
skeleton.push( | |
<div key={`skeleton-just-arrived-${i}`} className="px-4 relative card group"> | |
<div className="rounded-xl overflow-hidden card-shadow relative bg-gray-300" | |
style={{ width: "287px", height: "386px" }} > | |
</div> | |
<div className="w-8/12 h-3 absolute bottom-16 left-10 bg-gray-400 mt-3 rounded-full"></div> | |
<div className="w-6/12 h-3 absolute bottom-10 left-10 bg-gray-400 mt-3 rounded-full"></div> | |
</div> | |
) | |
} | |
return skeleton | |
} |
Top comments (2)
You could make this a bit simpler by using new Array which lets you just say how long you want an array to be.
great🔥