mirror of
https://github.com/BradNut/boredgame
synced 2025-09-08 17:40:22 +00:00
22 lines
488 B
Svelte
22 lines
488 B
Svelte
|
|
<script lang="ts">
|
||
|
|
import type { Label as LabelPrimitive } from "bits-ui";
|
||
|
|
import { getFormField } from "formsnap";
|
||
|
|
import { cn } from "@/utils";
|
||
|
|
import { Label } from "$lib/components/ui/label";
|
||
|
|
|
||
|
|
type $$Props = LabelPrimitive.Props;
|
||
|
|
|
||
|
|
let className: $$Props["class"] = undefined;
|
||
|
|
export { className as class };
|
||
|
|
|
||
|
|
const { errors, ids } = getFormField();
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<Label
|
||
|
|
for={ids.input}
|
||
|
|
class={cn($errors && "text-destructive", className)}
|
||
|
|
{...$$restProps}
|
||
|
|
>
|
||
|
|
<slot />
|
||
|
|
</Label>
|