diff --git a/src/pages/Secrets/KeyValue/KeyValueDelete.ts b/src/pages/Secrets/KeyValue/KeyValueDelete.tsx similarity index 51% rename from src/pages/Secrets/KeyValue/KeyValueDelete.ts rename to src/pages/Secrets/KeyValue/KeyValueDelete.tsx index 7de8715..c7714a6 100644 --- a/src/pages/Secrets/KeyValue/KeyValueDelete.ts +++ b/src/pages/Secrets/KeyValue/KeyValueDelete.tsx @@ -1,7 +1,7 @@ import { Page } from "../../../types/Page"; import { SecretTitleElement } from "../SecretTitleElement"; import { deleteSecret } from "../../../api/kv/deleteSecret"; -import { makeElement } from "z-makeelement"; +import { render } from "preact"; import i18next from "i18next"; export class KeyValueDeletePage extends Page { @@ -18,31 +18,26 @@ export class KeyValueDeletePage extends Page { } } async render(): Promise { - await this.router.setPageContent( - makeElement({ - tag: "div", - children: [ - makeElement({ - tag: "h5", - text: i18next.t("kv_delete_text"), - }), - makeElement({ - tag: "button", - class: ["uk-button", "uk-button-danger"], - text: i18next.t("kv_delete_btn"), - onclick: async () => { - await deleteSecret( - this.state.baseMount, - this.state.secretMountType, - this.state.secretPath, - this.state.secretItem, - this.state.secretVersion, - ); - await this.goBack(); - }, - }), - ], - }), + render( +
+
{i18next.t("kv_delete_text")}
+ +
, + this.router.pageContentElement, ); }