2026-06-22 20:36:57 +00:00
|
|
|
<script lang="ts">
|
2026-07-15 21:23:43 +00:00
|
|
|
import cx from "classnames"
|
2026-07-28 16:16:26 +00:00
|
|
|
import type {RelayRoleReader} from "@welshman/domain"
|
|
|
|
|
import {roleColor} from "@app/roles"
|
2026-06-22 20:36:57 +00:00
|
|
|
|
2026-07-15 21:23:43 +00:00
|
|
|
type Props = {
|
2026-07-28 16:16:26 +00:00
|
|
|
role: RelayRoleReader
|
2026-07-15 21:23:43 +00:00
|
|
|
size?: "sm" | "md"
|
2026-06-22 20:36:57 +00:00
|
|
|
}
|
|
|
|
|
|
2026-07-15 21:23:43 +00:00
|
|
|
const {role, size = "sm"}: Props = $props()
|
2026-06-22 20:36:57 +00:00
|
|
|
</script>
|
|
|
|
|
|
2026-07-15 21:23:43 +00:00
|
|
|
<span
|
|
|
|
|
class={cx("role-badge", size === "md" && "role-badge--md")}
|
2026-07-28 16:16:26 +00:00
|
|
|
style="--role-color: {roleColor(role.color() ?? 0)}">
|
2026-07-15 21:23:43 +00:00
|
|
|
<span class="role-badge__dot" aria-hidden="true"></span>
|
2026-07-28 16:16:26 +00:00
|
|
|
{role.label() || "Untitled Role"}
|
2026-07-15 21:23:43 +00:00
|
|
|
</span>
|