From 77b03b17a59655c1eeb00e0a818c81f8ea5e326e Mon Sep 17 00:00:00 2001 From: crupest Date: Sat, 29 Jul 2023 22:41:32 +0800 Subject: ... --- FrontEnd/src/views/common/input/InputGroup.tsx | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'FrontEnd/src/views') diff --git a/FrontEnd/src/views/common/input/InputGroup.tsx b/FrontEnd/src/views/common/input/InputGroup.tsx index 3d1e3ada..ee89b05c 100644 --- a/FrontEnd/src/views/common/input/InputGroup.tsx +++ b/FrontEnd/src/views/common/input/InputGroup.tsx @@ -23,7 +23,7 @@ * `useInputs` hook takes care of logic and generate props for `InputGroup`. */ -import { useState, Ref } from "react"; +import { useState, Ref, useId } from "react"; import classNames from "classnames"; import { useC, Text, ThemeColor } from "../common"; @@ -332,6 +332,8 @@ export function InputGroup({ }: InputGroupProps) { const c = useC(); + const id = useId(); + return (
- {label && } + {label && ( + + )} { @@ -382,6 +391,7 @@ export function InputGroup({ return (
{ @@ -390,7 +400,9 @@ export function InputGroup({ }} disabled={disabled} /> - + {error &&
{c(error)}
} {helper &&
{c(helper)}
}
@@ -398,8 +410,11 @@ export function InputGroup({ } else if (type === "select") { return (
- +