Add empty enums illustration
This commit is contained in:
parent
a7fd4ec416
commit
3b1af3772e
@ -4,6 +4,7 @@ import { IconPlus } from "@douyinfe/semi-icons";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import SearchBar from "./SearchBar";
|
import SearchBar from "./SearchBar";
|
||||||
import EnumDetails from "./EnumDetails";
|
import EnumDetails from "./EnumDetails";
|
||||||
|
import Empty from "../Empty";
|
||||||
|
|
||||||
export default function EnumsTab() {
|
export default function EnumsTab() {
|
||||||
const { enums, addEnum } = useEnums();
|
const { enums, addEnum } = useEnums();
|
||||||
@ -19,6 +20,9 @@ export default function EnumsTab() {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{enums.length <= 0 ? (
|
||||||
|
<Empty title={t("no_enums")} text={t("no_enums_text")} />
|
||||||
|
) : (
|
||||||
<Collapse accordion>
|
<Collapse accordion>
|
||||||
{enums.map((e, i) => (
|
{enums.map((e, i) => (
|
||||||
<Collapse.Panel
|
<Collapse.Panel
|
||||||
@ -35,6 +39,7 @@ export default function EnumsTab() {
|
|||||||
</Collapse.Panel>
|
</Collapse.Panel>
|
||||||
))}
|
))}
|
||||||
</Collapse>
|
</Collapse>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -223,6 +223,8 @@ const en = {
|
|||||||
enum_w_no_name: "Found enum with no name",
|
enum_w_no_name: "Found enum with no name",
|
||||||
enum_w_no_values: "Found enum '{{enumName}}' with no values",
|
enum_w_no_values: "Found enum '{{enumName}}' with no values",
|
||||||
duplicate_enums: "Duplicate enums with the name '{{enumName}}'",
|
duplicate_enums: "Duplicate enums with the name '{{enumName}}'",
|
||||||
|
no_enums: "No enums",
|
||||||
|
no_enums_text: "Define enums here",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user