aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/views/common/input
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-04-29 23:15:47 +0800
committercrupest <crupest@outlook.com>2022-04-29 23:15:47 +0800
commit96440778a85cd5106959b7a779080ad90e6ccbdb (patch)
tree069d1be2cc5190ba6a6975c76c568801bea0badd /FrontEnd/src/views/common/input
parentb46c397989df15149803cc1607448dd83c8781a7 (diff)
downloadtimeline-96440778a85cd5106959b7a779080ad90e6ccbdb.tar.gz
timeline-96440778a85cd5106959b7a779080ad90e6ccbdb.tar.bz2
timeline-96440778a85cd5106959b7a779080ad90e6ccbdb.zip
...
Diffstat (limited to 'FrontEnd/src/views/common/input')
-rw-r--r--FrontEnd/src/views/common/input/InputPanel.tsx8
1 files changed, 8 insertions, 0 deletions
diff --git a/FrontEnd/src/views/common/input/InputPanel.tsx b/FrontEnd/src/views/common/input/InputPanel.tsx
index 704330eb..3ac0cb04 100644
--- a/FrontEnd/src/views/common/input/InputPanel.tsx
+++ b/FrontEnd/src/views/common/input/InputPanel.tsx
@@ -76,6 +76,14 @@ export type InputPanelError = {
[index: number]: I18nText | null | undefined;
};
+export function hasError(e: InputPanelError | null | undefined): boolean {
+ if (e == null) return false;
+ for (const key in e) {
+ if (e[key] != null) return true;
+ }
+ return false;
+}
+
export interface InputPanelProps<InputList extends readonly Input[]> {
scheme: InputList;
values: MapInputListToValueTypeList<InputList>;