fix: empty cell data renders in list (#699)
This commit is contained in:
@@ -3,9 +3,7 @@ import React from 'react';
|
||||
import './index.scss';
|
||||
|
||||
const CodeCell = ({ data }) => {
|
||||
let textToShow = '';
|
||||
|
||||
if (data) textToShow = data.length > 100 ? `${data.substr(0, 100)}\u2026` : data;
|
||||
const textToShow = data.length > 100 ? `${data.substring(0, 100)}\u2026` : data;
|
||||
|
||||
return (
|
||||
<code className="code-cell">
|
||||
|
||||
@@ -31,7 +31,7 @@ const DefaultCell: React.FC<Props> = (props) => {
|
||||
wrapElementProps.to = `${admin}/collections/${slug}/${id}`;
|
||||
}
|
||||
|
||||
const CellComponent = cellComponents[field.type];
|
||||
const CellComponent = cellData && cellComponents[field.type];
|
||||
|
||||
if (!CellComponent) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user