mirror of
https://github.com/hex248/sprint.git
synced 2026-02-07 18:23:03 +00:00
simple sprint display component
This commit is contained in:
25
packages/frontend/src/components/small-sprint-display.tsx
Normal file
25
packages/frontend/src/components/small-sprint-display.tsx
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import { DEFAULT_SPRINT_COLOUR, type SprintRecord } from "@issue/shared";
|
||||||
|
import { cn, DARK_TEXT_COLOUR, isLight } from "@/lib/utils";
|
||||||
|
|
||||||
|
export default function SmallSprintDisplay({
|
||||||
|
sprint,
|
||||||
|
className,
|
||||||
|
}: {
|
||||||
|
sprint?: SprintRecord;
|
||||||
|
className?: string;
|
||||||
|
}) {
|
||||||
|
const colour = sprint?.color || DEFAULT_SPRINT_COLOUR;
|
||||||
|
const textColour = isLight(colour) ? DARK_TEXT_COLOUR : "var(--foreground)";
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={cn(
|
||||||
|
"text-xs px-1.5 rounded-full inline-flex whitespace-nowrap border border-foreground/10",
|
||||||
|
className,
|
||||||
|
)}
|
||||||
|
style={{ backgroundColor: colour, color: textColour }}
|
||||||
|
>
|
||||||
|
{sprint?.name || "None"}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user