Skip to content

Commit

Permalink
more solid showContent
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuyz0112 committed Dec 15, 2023
1 parent 5268a8d commit db50e60
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/refine/src/components/ShowContent/ShowContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,15 @@ export const ShowContent = <Raw extends Resource, Model extends ResourceModel>(
if (!record) return null;
return fields.map(field => {
let content;
const path =
field.path[0] === 'rawYaml' ? field.path : ['rawYaml'].concat(field.path);
if (field.render) {
content = field.render(get(record, field.path), record);
content = field.render(get(record, path), record);
} else {
content = <span>{get(record, field.path)}</span>;
content = <span>{get(record, path)}</span>;
}
return (
<kit.space key={field.path.join()}>
<kit.space key={path.join()}>
<span className={Typo.Label.l3_regular}>{field.title}: </span>
{content}
</kit.space>
Expand Down

0 comments on commit db50e60

Please sign in to comment.