Skip to content

Commit

Permalink
fix: missing key for PointLegend
Browse files Browse the repository at this point in the history
  • Loading branch information
jschoedl committed Dec 21, 2024
1 parent b626102 commit 74729a3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/components/Legend/PointLegend.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { v4 as uuid } from 'uuid';

import { PointLegendProps } from '@/domain/props/PointLegendProps';

export default function PointLegend({ records, children }: PointLegendProps) {
Expand All @@ -10,7 +8,7 @@ export default function PointLegend({ records, children }: PointLegendProps) {
children ? (
children({ record })
) : (
<div key={uuid()} className="flex items-center space-x-2">
<div key={record.label} className="flex items-center space-x-2">
<span
className="w-3 h-3 rounded-full"
style={{ backgroundColor: `hsl(var(--nextui-${record.color}))` }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PointLegendRecord from '@/domain/props/PointLegendRecord';

export function CountryAlertLegendItem({ record }: { record: PointLegendRecord }) {
return (
<div className="flex gap-3 items-baseline">
<div className="flex gap-3 items-baseline" key={record.label}>
<div>
<div className={`w-3 h-3 bg-${countryAlertsColors[record.label as CountryAlertType]} rounded-full relative`}>
<div
Expand Down
2 changes: 1 addition & 1 deletion src/domain/constant/legend/mapLegendData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export function mapLegendData(
break;
case AlertType.COUNTRY_ALERTS:
legendData.push({
title: 'Country alerts',
title: 'Country Alerts',
popoverInfo: (
<div>
<p>Alerts on a country level.</p>
Expand Down

0 comments on commit 74729a3

Please sign in to comment.