summaryrefslogtreecommitdiff
path: root/frontend/src/components/logviewer/index.tsx
blob: 6e9baae0e4c408f46ee7512261ea91d231007e11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { DialogBody } from 'decky-frontend-lib';
import { FC, useEffect, useState } from 'react';

import LoggedPlugin from './LoggedPlugin';

const LogViewerPage: FC<{}> = () => {
  const [plugins, setPlugins] = useState([]);
  useEffect(() => {
    window.DeckyPluginLoader.callServerMethod('get_plugins_with_logs').then((plugins) => {
      setPlugins(plugins.result || []);
    });
  }, []);
  return (
    <DialogBody>
      {plugins.map((plugin) => <LoggedPlugin plugin={plugin} />)}
    </DialogBody>
  )
};

export default LogViewerPage;