diff --git a/client/src/components/jobs-documents-local-gallery/jobs-documents-local-gallery.container.jsx b/client/src/components/jobs-documents-local-gallery/jobs-documents-local-gallery.container.jsx index f58c8025c..5b8722d3d 100644 --- a/client/src/components/jobs-documents-local-gallery/jobs-documents-local-gallery.container.jsx +++ b/client/src/components/jobs-documents-local-gallery/jobs-documents-local-gallery.container.jsx @@ -1,4 +1,4 @@ -import { SyncOutlined } from "@ant-design/icons"; +import { SyncOutlined, FileExcelFilled } from "@ant-design/icons"; import { Button, Card, Space } from "antd"; import React, { useEffect } from "react"; import Gallery from "react-grid-gallery"; @@ -58,6 +58,24 @@ export function JobsDocumentsLocalGallery({ } }, [job, invoice_number, getJobMedia, getBillMedia]); + const jobMedia = + allMedia && allMedia[job.id] + ? allMedia[job.id].reduce( + (acc, val) => { + if ( + val.type && + val.type.mime && + val.type.mime.startsWith("image") + ) { + acc.images.push(val); + } else { + acc.other.push(val); + } + return acc; + }, + { images: [], other: [] } + ) + : { images: [], other: [] }; return (