import React, { memo, useEffect, useState } from 'react' import { Button } from '@janhq/joi' import { CopyIcon, CheckIcon } from 'lucide-react' import { twMerge } from 'tailwind-merge' import { useClipboard } from '@/hooks/useClipboard' import { useLogs } from '@/hooks/useLogs' const DeviceSpecs = () => { const { getLogs } = useLogs() const [logs, setLogs] = useState([]) useEffect(() => { getLogs('app').then((log) => { if (typeof log?.split === 'function') { setLogs( log.split(/\r?\n|\r|\n/g).filter((e) => e.includes('[SPECS]::')) ) } }) // eslint-disable-next-line react-hooks/exhaustive-deps }, []) const clipboard = useClipboard({ timeout: 1000 }) return (
{logs.length > 0 ? ( {logs.slice(-100).map((log, i) => { return (

{log}

) })}
) : (

Empty logs

)}
) } export default memo(DeviceSpecs)