Simpler card tag badges

This commit is contained in:
Sacha Weatherstone 2021-12-23 18:16:21 +11:00
parent 118b5be7bb
commit 1fa41e7d52

View file

@ -8,38 +8,22 @@ export interface CardTagsProps {
export const CardTags = ({ tags }: CardTagsProps) => { export const CardTags = ({ tags }: CardTagsProps) => {
return ( return (
<ul className="pills"> <div>
{tags.map(({ color, description, label }, index) => { {tags.map(({ color, label }, index) => {
return ( return (
<li <span
className="badge"
key={index} key={index}
style={{ style={{
display: "inline-flex", backgroundColor: color,
alignItems: "center", marginRight: "0.3rem",
alignContent: "center",
gap: "0.3rem",
fontSize: "0.6rem",
lineHeight: "1rem",
cursor: "default",
userSelect: "none", userSelect: "none",
padding: "0.2rem",
border: "2px solid gray",
}} }}
className="pills__item"
title={description}
> >
<span>{label.toLowerCase()}</span> {label}
<span </span>
style={{
backgroundColor: color,
width: "0.5rem",
height: "0.5rem",
borderRadius: "50%",
}}
/>
</li>
); );
})} })}
</ul> </div>
); );
}; };