import React from 'react'; const tailwindColors = { red: '#dc2626', yellow: '#d97706', green: '#16a34a', blue: '#2563eb', indigo: '#4f46e5', purple: '#7c3aed', pink: '#db2777', gray: '#4b5563', }; const Card = ({ space_id, author, title, description, emoji, lastModified, colorFrom, colorTo, likes, sdk, runtimeStage, currentHardware, }) => { const gradientStyle = { background: `linear-gradient(to bottom right, ${tailwindColors[colorFrom]}, ${tailwindColors[colorTo]})`, }; const spaceUrl = `https://huggingface.co/spaces/${space_id}`; let runtimeStageIcon = null; if (runtimeStage === 'STOPPED') { runtimeStageIcon = ; } else if (runtimeStage.includes('ERROR')) { runtimeStageIcon = ; } return (
{emoji} {title}
{runtimeStageIcon} {runtimeStage} {runtimeStage === "RUNNING" && ( <> on {currentHardware} )}
{lastModified}
{likes}

{description}

); }; export default Card;