/** * External dependencies */ import { Card, CardBody, CardHeader, // @ts-ignore No types for this exist yet. __experimentalItem as Item, // @ts-ignore No types for this exist yet. __experimentalItemGroup as ItemGroup, // @ts-ignore No types for this exist yet. __experimentalScrollable as Scrollable, Spinner, } from '@wordpress/components'; /** * Internal dependencies */ import { useJobLog } from '../data/useJobs'; export const JobLog = () => { const { jobLogs, isLoading, error } = useJobLog(); if ( isLoading ) { return ( Job Log ); } if ( error ) { return ( Job Log { error } ); } if ( ! jobLogs.length && ! isLoading ) { return ( Job Log No job logs found. ); } return ( Job Log { jobLogs.map( ( jobLog, i ) => ( Message: { jobLog.message } Logged at: { jobLog.date } ) ) } ); };
{ error }
No job logs found.