Files
mutiny-web/src/components/Logs.tsx
2023-05-11 11:01:07 -05:00

22 lines
655 B
TypeScript

import { Button, Card, NiceP, VStack } from "~/components/layout";
import { useMegaStore } from "~/state/megaStore";
import { downloadTextFile } from "~/utils/download";
export function Logs() {
const [state, _] = useMegaStore()
async function handleSave() {
const logs = await state.mutiny_wallet?.get_logs()
downloadTextFile(logs.join("") || "", "mutiny-logs.txt", "text/plain")
}
return (
<Card>
<VStack>
<NiceP>Something screwy going on? Check out the logs!</NiceP>
<Button onClick={handleSave}>Download Logs</Button>
</VStack>
</Card>
)
}