import { h, type FunctionComponent } from 'preact' import { useEffect, useState } from 'preact/hooks' import _ from 'lodash' import rek from 'rek' import ObjectTable from './object_table.tsx' import { Table, Td } from './table.tsx' const Process: FunctionComponent<{ os?: ANY }> = ({ os }) => { const [process, setProcess] = useState<{ os: Record process: Record | string[]> } | null>(null) useEffect(() => { rek('/api/process').then(setProcess) }, []) return ( process && ( {Object.entries(process[os ? 'os' : 'process']).map(([key, value]) => ( ))}
{key} {Array.isArray(value) ? ( value.join(', ') ) : _.isPlainObject(value) ? ( ) : ( value )}
) ) } export default Process