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={{
display: "inline-flex",
alignItems: "center",
alignContent: "center",
gap: "0.3rem",
fontSize: "0.6rem",
lineHeight: "1rem",
cursor: "default",
userSelect: "none",
padding: "0.2rem",
border: "2px solid gray",
}}
className="pills__item"
title={description}
>
<span>{label.toLowerCase()}</span>
<span
style={{ style={{
backgroundColor: color, backgroundColor: color,
width: "0.5rem", marginRight: "0.3rem",
height: "0.5rem", userSelect: "none",
borderRadius: "50%",
}} }}
/> >
</li> {label}
</span>
); );
})} })}
</ul> </div>
); );
}; };