2026-06-24 20:56:53 +00:00
|
|
|
<script lang="ts">
|
|
|
|
|
import type {Snippet} from "svelte"
|
2026-07-27 22:38:23 +00:00
|
|
|
import type {HTMLAttributes} from "svelte/elements"
|
2026-06-24 20:56:53 +00:00
|
|
|
import cx from "classnames"
|
|
|
|
|
|
2026-07-27 22:38:23 +00:00
|
|
|
type Props = HTMLAttributes<HTMLSpanElement> & {
|
2026-06-24 20:56:53 +00:00
|
|
|
children?: Snippet
|
|
|
|
|
variant?: "neutral" | "primary" | "warning"
|
2026-07-27 22:38:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const {children, variant = "neutral", ...restProps}: Props = $props()
|
2026-06-24 20:56:53 +00:00
|
|
|
|
|
|
|
|
const className = $derived(cx("badge", `badge-${variant}`, restProps.class))
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<span {...restProps} class={className}>
|
|
|
|
|
{@render children?.()}
|
|
|
|
|
</span>
|