Repository: strapi/strapi
File: examples/getstarted/src/admin/preview/dummy-preview.jsx (JavaScript)

Code before:
                    Document Id
                  </Typography>
                  <Flex gap={3} direction="column" alignItems="start" tag="dd">
                    <Typography>{documentId}</Typography>
                  </Flex>
                </Grid.Item>
                <Grid.Item col={6} s={12} direction="column" alignItems="start">
                  <Typography variant="sigma" textColor="neutral600" tag="dt">
                    Status
                  </Typography>
                  <Flex gap={3} direction="column" alignItems="start" tag="dd">
                    <Typography>{documentStatus}</Typography>
                  </Flex>
                </Grid.Item>
                <Grid.Item col={6} s={12} direction="column" alignItems="start">
                  <Typography variant="sigma" textColor="neutral600" tag="dt">
                    Locale
                  </Typography>
                  <Typography tag="dd">{locale}</Typography>
                </Grid.Item>
              </Grid.Root>
              <Typography variant="delta" tag="h3">
                Rest API data
              </Typography>
              {revalidator.state === 'loading' && <Typography>Refreshing data...</Typography>}
              {!data && <Typography textColor="neutral600">No data found</Typography>}
              {data && (
                <>
                  <Grid.Root gap={5} tag="dl">
                    {filterAttributes(data).map(([key, value]) => (
                      <Grid.Item key={key} col={6} s={12} direction="column" alignItems="start">
                        <Typography variant="sigma" textColor="neutral600" tag="dt">
                          {key}
                        </Typography>
                        <Flex gap={3} direction="column" alignItems="start" tag="dd">
                          <Typography>
                            {typeof value === 'object' && value !== null
                              ? JSON.stringify(value, null, 2)
                              : String(value)}
                          </Typography>
                        </Flex>
                      </Grid.Item>
                    ))}
                  </Grid.Root>
                  <JSONInput value={JSON.stringify(data, null, 2)} disabled />
                </>
              )}
            </Flex>
          </Layouts.Content>
        </Page.Main>
      </Layouts.Root>

Review comment (suggestion):
You could merge into one condition `!data ? () : ()`

Code after:
                    <Typography>{apiName}</Typography>
                  </Flex>
                </Grid.Item>
                <Grid.Item col={6} s={12} direction="column" alignItems="start">
                  <Typography variant="sigma" textColor="neutral600" tag="dt">
                    Document Id
                  </Typography>
                  <Flex gap={3} direction="column" alignItems="start" tag="dd">
                    <Typography>{documentId}</Typography>
                  </Flex>
                </Grid.Item>
                <Grid.Item col={6} s={12} direction="column" alignItems="start">
                  <Typography variant="sigma" textColor="neutral600" tag="dt">
                    Status
                  </Typography>
                  <Flex gap={3} direction="column" alignItems="start" tag="dd">
                    <Typography>{documentStatus}</Typography>
                  </Flex>
                </Grid.Item>
                <Grid.Item col={6} s={12} direction="column" alignItems="start">
                  <Typography variant="sigma" textColor="neutral600" tag="dt">
                    Locale
                  </Typography>
                  <Typography tag="dd">{locale}</Typography>
                </Grid.Item>
              </Grid.Root>
              <Typography variant="delta" tag="h3">
                Rest API data
              </Typography>
              {revalidator.state === 'loading' && <Typography>Refreshing data...</Typography>}
              {data ? (
                <>
                  <Grid.Root gap={5} tag="dl">
                    {filterAttributes(data).map(([key, value]) => (
                      <Grid.Item key={key} col={6} s={12} direction="column" alignItems="start">
                        <Typography variant="sigma" textColor="neutral600" tag="dt">
                          {key}
                        </Typography>
                        <Flex gap={3} direction="column" alignItems="start" tag="dd">
                          <Typography>
                            {typeof value === 'object' && value !== null
                              ? JSON.stringify(value, null, 2)
                              : String(value)}
                          </Typography>
                        </Flex>
                      </Grid.Item>
                    ))}
                  </Grid.Root>
                  <JSONInput value={JSON.stringify(data, null, 2)} disabled />
                </>
              ) : (