26 lines
681 B
Svelte
26 lines
681 B
Svelte
<script lang="ts">
|
|
import type { Kind } from "$lib/api/types";
|
|
import { cn } from "$lib/utils";
|
|
|
|
let { kind, class: className = "" }: { kind: Kind | string; class?: string } =
|
|
$props();
|
|
|
|
const STYLE: Record<string, string> = {
|
|
branch: "bg-kind-branch/12 text-kind-branch",
|
|
deep: "bg-kind-deep/12 text-kind-deep",
|
|
fork: "bg-kind-fork/12 text-kind-fork",
|
|
job: "bg-kind-job/12 text-kind-job",
|
|
master: "bg-kind-master/12 text-kind-master",
|
|
};
|
|
</script>
|
|
|
|
<span
|
|
class={cn(
|
|
"inline-flex h-5 items-center rounded-md px-1.5 font-medium text-xs leading-none",
|
|
STYLE[kind] ?? "bg-muted text-muted-foreground",
|
|
className
|
|
)}
|
|
>
|
|
{kind}
|
|
</span>
|