mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2025-12-23 17:14:23 +01:00
add log downloader
This commit is contained in:
22
src/components/Logs.tsx
Normal file
22
src/components/Logs.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
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>
|
||||
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user