From 0005595703b2f3f7083ce4ba19bf5770057c75bd Mon Sep 17 00:00:00 2001
From: ivarlovlie <git@ivarlovlie.no>
Date: Tue, 25 Oct 2022 17:51:37 +0800
Subject: .

---
 code/app/src/lib/components/checkbox.svelte | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'code/app/src/lib/components/checkbox.svelte')

diff --git a/code/app/src/lib/components/checkbox.svelte b/code/app/src/lib/components/checkbox.svelte
index b2fcddb..12ebedb 100644
--- a/code/app/src/lib/components/checkbox.svelte
+++ b/code/app/src/lib/components/checkbox.svelte
@@ -7,6 +7,7 @@
     export let name: string | undefined = undefined;
     export let disabled: boolean | null = null;
     export let checked: boolean;
+    export let required: boolean | null = null;
     export let _pwKey: string | undefined = undefined;
 </script>
 
@@ -16,9 +17,13 @@
         use:pwKey={_pwKey}
         {disabled}
         {id}
+        {required}
         type="checkbox"
         bind:checked
         class="h-4 w-4 text-teal-600 focus:ring-teal-500 border-gray-300 rounded"
     />
-    <label for={id} class="ml-2 block text-sm text-gray-900">{label}</label>
+    <label for={id} class="ml-2 block text-sm text-gray-900">
+        {@html required ? "<span class='text-red-500'>*</span>" : ""}
+        {label}
+    </label>
 </div>
-- 
cgit v1.3

