fix: In chart gallery thumbnail is rendered in case of no example in #16707 (#26415)

This commit is contained in:
Siva Sathyaseelan 2024-01-09 00:14:58 +05:30 committed by GitHub
parent 3a6dc1d24e
commit 6d58566779
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 2 deletions

View File

@ -849,10 +849,18 @@ export default function VizTypeGallery(props: VizTypeGalleryProps) {
grid-area: examples-header;
`}
>
{!!selectedVizMetadata?.exampleGallery?.length && t('Examples')}
{t('Examples')}
</SectionTitle>
<Examples>
{(selectedVizMetadata?.exampleGallery || []).map(example => (
{(selectedVizMetadata?.exampleGallery?.length
? selectedVizMetadata.exampleGallery
: [
{
url: selectedVizMetadata?.thumbnail,
caption: selectedVizMetadata?.name,
},
]
).map(example => (
<img
key={example.url}
src={example.url}