From 3b1af3772e860474b8b8b948474bfb5c560862d3 Mon Sep 17 00:00:00 2001 From: 1ilit Date: Thu, 4 Jul 2024 23:06:09 +0300 Subject: [PATCH] Add empty enums illustration --- .../EditorSidePanel/EnumsTab/EnumsTab.jsx | 37 +++++++++++-------- src/i18n/locales/en.js | 2 + 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/components/EditorSidePanel/EnumsTab/EnumsTab.jsx b/src/components/EditorSidePanel/EnumsTab/EnumsTab.jsx index 395d91a..be3c32c 100644 --- a/src/components/EditorSidePanel/EnumsTab/EnumsTab.jsx +++ b/src/components/EditorSidePanel/EnumsTab/EnumsTab.jsx @@ -4,6 +4,7 @@ import { IconPlus } from "@douyinfe/semi-icons"; import { useTranslation } from "react-i18next"; import SearchBar from "./SearchBar"; import EnumDetails from "./EnumDetails"; +import Empty from "../Empty"; export default function EnumsTab() { const { enums, addEnum } = useEnums(); @@ -19,22 +20,26 @@ export default function EnumsTab() { - - {enums.map((e, i) => ( - - {e.name} - - } - itemKey={`${i}`} - > - - - ))} - + {enums.length <= 0 ? ( + + ) : ( + + {enums.map((e, i) => ( + + {e.name} + + } + itemKey={`${i}`} + > + + + ))} + + )} ); } diff --git a/src/i18n/locales/en.js b/src/i18n/locales/en.js index 2998d59..660212b 100644 --- a/src/i18n/locales/en.js +++ b/src/i18n/locales/en.js @@ -223,6 +223,8 @@ const en = { enum_w_no_name: "Found enum with no name", enum_w_no_values: "Found enum '{{enumName}}' with no values", duplicate_enums: "Duplicate enums with the name '{{enumName}}'", + no_enums: "No enums", + no_enums_text: "Define enums here", }, };