/** * External dependencies */ import { Card, CardBody, CardHeader, __experimentalItem as Item, __experimentalItemGroup as ItemGroup, __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 }

) ) }
); };