Skip to content

Commit

Permalink
Fixed errors with no img src and duplicated map keys
Browse files Browse the repository at this point in the history
  • Loading branch information
rayceramsay committed Sep 4, 2024
1 parent 48227cf commit eb94361
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions frontend/src/components/admin/DashboardClickChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ export default function DashboardClickChart({ data, interval, type }: ClickChart
getChartWrapper={(wrapper) => setChartWrapper(wrapper)}
/>
</div>
<div className={styles.chartImageContainer}>
<Image src={chartImageURI} alt={`${title} Chart`} layout='fill' />
</div>
{chartImageURI ? (
<div className={styles.chartImageContainer}>
<Image src={chartImageURI} alt={`${title} Chart`} layout='fill' />
</div>
) : null}
</>
) : (
<div className={styles.noDataMessage}>No data</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/admin/DashboardTwoItemTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function DashboardTwoItemTable({ firstHeading, secondHeading, dat
<tbody>
{data.length ? (
data.map((row) => (
<tr key={row[0]}>
<tr key={firstHeading + secondHeading + row[0] + row[1]}>
<td>{row[0]}</td>
<td>{row[1]}</td>
</tr>
Expand Down

0 comments on commit eb94361

Please sign in to comment.