forked from github/plane
538d67dbd9
* chore: update border colors * chore: loading screens bg color, custom theming default values * chore: remove unnecessary images * chore: update static colors * chore: update old variable names * chore: update issue activity icon colors * chore: update user activity icon colors
33 lines
824 B
TypeScript
33 lines
824 B
TypeScript
import React from "react";
|
|
|
|
type IssueLabelsListProps = {
|
|
labels?: (string | undefined)[];
|
|
length?: number;
|
|
showLength?: boolean;
|
|
};
|
|
|
|
export const IssueLabelsList: React.FC<IssueLabelsListProps> = ({
|
|
labels,
|
|
length = 5,
|
|
showLength = true,
|
|
}) => (
|
|
<>
|
|
{labels && (
|
|
<>
|
|
{labels.slice(0, length).map((color, index) => (
|
|
<div className={`flex h-4 w-4 rounded-full ${index ? "-ml-3.5" : ""}`}>
|
|
<span
|
|
className={`h-4 w-4 flex-shrink-0 rounded-full border border-custom-border-200
|
|
`}
|
|
style={{
|
|
backgroundColor: color && color !== "" ? color : "#000000",
|
|
}}
|
|
/>
|
|
</div>
|
|
))}
|
|
{labels.length > length ? <span>+{labels.length - length}</span> : null}
|
|
</>
|
|
)}
|
|
</>
|
|
);
|