import React from 'react'; import CardBox from '../CardBox'; import ImageField from '../ImageField'; import dataFormatter from '../../helpers/dataFormatter'; import {saveFile} from "../../helpers/fileSaver"; import ListActionsPopover from "../ListActionsPopover"; import {useAppSelector} from "../../stores/hooks"; import {Pagination} from "../Pagination"; import LoadingSpinner from "../LoadingSpinner"; import Link from 'next/link'; import {hasPermission} from "../../helpers/userPermissions"; type Props = { job_logs: any[]; loading: boolean; onDelete: (id: string) => void; currentPage: number; numPages: number; onPageChange: (page: number) => void; }; const ListJob_logs = ({ job_logs, loading, onDelete, currentPage, numPages, onPageChange }: Props) => { const currentUser = useAppSelector((state) => state.auth.currentUser); const hasUpdatePermission = hasPermission(currentUser, 'UPDATE_JOB_LOGS') const corners = useAppSelector((state) => state.style.corners); const bgColor = useAppSelector((state) => state.style.cardsColor); return ( <>
{loading && } {!loading && job_logs.map((item) => (
dark:divide-dark-700 overflow-x-auto' } >

WorkDate

{ dataFormatter.dateTimeFormatter(item.work_date) }

Employee

{ dataFormatter.usersOneListFormatter(item.employee) }

Customer

{ dataFormatter.customersOneListFormatter(item.customer) }

HoursConducted

{ item.hours_conducted }

ClientPaid

{ item.client_paid }

WorkmansCompensationClass

{ item.workersCompClass?.name }

PayType

{ dataFormatter.pay_typesOneListFormatter(item.pay_type) }

Vehicle

{ dataFormatter.vehiclesOneListFormatter(item.vehicle) }

OdometerStart

{ item.odometer_start }

OdometerEnd

{ item.odometer_end }

JobAddress

{ item.job_address }

Status

{ item.status }

NotesToAdmin

{ item.notes_to_admin }

))} {!loading && job_logs.length === 0 && (

No data to display

)}
) }; export default ListJob_logs