import React, { useEffect, useState } from 'react';
import styled from 'styled-components';
import { fetch } from '../util/logging';
const StyledContent = styled.div`
display: flex;
flex-direction: column;
padding: 10px;
height: 100%;
`;
const DebugLogTextArea = (props: { content: string }) => {
console.warn('DebugLogTextArea ', props.content);
// tslint:disable-next-line: react-a11y-input-elements
return ;
};
const DebugLogButtons = (props: { content: string }) => {
return (
);
};
const DebugLogViewAndSave = () => {
const [content, setContent] = useState(window.i18n('loading'));
useEffect(() => {
const operatingSystemInfo = `Operating System: ${(window as any).getOSRelease()}`;
const commitHashInfo = (window as any).getCommitHash()
? `Commit Hash: ${(window as any).getCommitHash()}`
: '';
// eslint-disable-next-line more/no-then
fetch()
.then((text: any) => {
const debugLogWithSystemInfo = `${operatingSystemInfo} ${commitHashInfo} ${text}`;
setContent(debugLogWithSystemInfo);
})
.catch(console.warn);
}, []);
return (
<>
>
);
};
export const DebugLogView = () => {
return (
);
};