Skip to content

Commit

Permalink
Add missing keys for loops inside jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
dtrucs committed Nov 12, 2024
1 parent 0d8ad1b commit b548b11
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/map-filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ export default function MapFilters() {
return (
<div className="bg-background px-3">
<p className="sr-only">{t('site.loading')}</p>
{Array.from({ length: 4 }, () => (
<div className="flex w-full justify-between border-b py-4 last:border-b-0">
{Array.from({ length: 4 }, (_, index) => (
<div
key={index}
className="flex w-full justify-between border-b py-4 last:border-b-0"
>
<div className="skeleton-animation h-6 w-32 rounded"></div>
<div className="skeleton-animation h-6 w-12 rounded-xl"></div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/components/observation-cta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export function ObservationCTA() {
<ul className="m-auto grid grid-cols-2 gap-2 p-6 md:w-[400px]">
{observations?.map(observation => (
<ListItem
key={observation.id}
href={`/map/observation/${
observation.id
}?${params.toString()}`}
Expand All @@ -47,6 +48,7 @@ export function ObservationCTA() {
{observations?.length === 0 &&
DEFAULT_OBSERVATION_TYPES.map(observation => (
<ListItem
key={observation}
href={`/map/observation/${observation}?${params.toString()}`}
title={t(`${observation}.label`)}
>
Expand Down

0 comments on commit b548b11

Please sign in to comment.