From c04d9fc80a02c83314d7dd546eda38e5d70e6a3e Mon Sep 17 00:00:00 2001 From: luizakp Date: Mon, 19 Aug 2024 15:18:39 -0300 Subject: [PATCH] chore: if image doesn't exist, show value --- .../DataTable/SWRDataTable/index.tsx | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/components/DataTable/SWRDataTable/index.tsx b/src/components/DataTable/SWRDataTable/index.tsx index a0bffc8..f22343f 100644 --- a/src/components/DataTable/SWRDataTable/index.tsx +++ b/src/components/DataTable/SWRDataTable/index.tsx @@ -115,14 +115,18 @@ export const renderDataTableCell = ({ filters, column, row, selectedRows }) => { case "actions": return ; case "image": - if (!row.getValue("image")?.url) return null; - return ( - {row.getValue("name")} - ); + const image = row.getValue("image") || value; + if (image?.url){ + return ( + {image.alt_text} + ); + } else { + return
{value}
; + } case "link": // eslint-disable-next-line no-case-declarations const url = row.getValue("details_url");