HemHub
- Frontend har startat.
- {statusMessage}
+ Vem är du?
+
+ {users.map((user) => (
+
+ ))}
+
+
+
+ )
+}
+
+type CreateUserFormProps = {
+ hasExistingUsers: boolean
+ onCancel: () => void
+ onCreated: (user: User) => void
+}
+
+function CreateUserForm({ hasExistingUsers, onCancel, onCreated }: CreateUserFormProps) {
+ const [name, setName] = useState('')
+ const [error, setError] = useState('')
+ const [isSubmitting, setIsSubmitting] = useState(false)
+ const isSubmittingRef = useRef(false)
+
+ const submit = async (event: FormEvent