mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2026-01-30 11:34:20 +01:00
36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
import { MutinyWallet } from "@mutinywallet/mutiny-wasm";
|
|
|
|
import { Button, InnerCard, NiceP, VStack } from "~/components";
|
|
import { useI18n } from "~/i18n/context";
|
|
import { downloadTextFile } from "~/utils/download";
|
|
|
|
export function Logs() {
|
|
const i18n = useI18n();
|
|
async function handleSave() {
|
|
try {
|
|
const logs = await MutinyWallet.get_logs();
|
|
|
|
await downloadTextFile(
|
|
logs.join("") || "",
|
|
"mutiny-logs.txt",
|
|
"text/plain"
|
|
);
|
|
} catch (e) {
|
|
console.error(e);
|
|
}
|
|
}
|
|
|
|
return (
|
|
<InnerCard title={i18n.t("settings.emergency_kit.logs.title")}>
|
|
<VStack>
|
|
<NiceP>
|
|
{i18n.t("settings.emergency_kit.logs.something_screwy")}
|
|
</NiceP>
|
|
<Button intent="green" onClick={handleSave}>
|
|
{i18n.t("settings.emergency_kit.logs.download_logs")}
|
|
</Button>
|
|
</VStack>
|
|
</InnerCard>
|
|
);
|
|
}
|