Skip to content

Commit

Permalink
Fix keys on dashboard components (#728)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshithmohan authored Dec 22, 2023
1 parent f74110d commit f22f5c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/pages/dashboard/panels/CollectionStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { useDashbordStatsQuery } from '@/core/react-query/dashboard/queries';
import type { RootState } from '@/core/store';

const Item = (
{ key, link, title, value = 0 }: { key: string, title: string, value?: string | number, link?: string },
{ link, title, value = 0 }: { title: string, value?: string | number, link?: string },
) => (
<div key={key} className="flex">
<div className="flex">
<div className="mb-1 grow last:mb-0">
{title}
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/dashboard/panels/MediaType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const getColor = (type: string) => {

const Item = ({ count, countPercentage, item }: { count: number, countPercentage: number, item: string }) => (
<>
<div key={`${item}-name`} className="mt-5 flex first:mt-0">
<div className="mt-5 flex first:mt-0">
<span className="grow">
{names[item] ?? item}
&nbsp;-&nbsp;
Expand All @@ -42,7 +42,7 @@ const Item = ({ count, countPercentage, item }: { count: number, countPercentage
%
</span>
</div>
<div key={`${item}-bar`} className="mt-2 flex rounded-md bg-panel-input">
<div className="mt-2 flex rounded-md bg-panel-input">
{/* eslint-disable-next-line tailwindcss/no-custom-classname */}
<div className={`bg-${getColor(item)} h-4 rounded-md`} style={{ width: `${countPercentage}%` }} />
</div>
Expand Down Expand Up @@ -70,7 +70,7 @@ function MediaType() {
if (total) {
countPercentage = (item[1] / total) * 100;
}
items.push(<Item item={item[0]} count={item[1]} countPercentage={countPercentage} />);
items.push(<Item key={item[0]} item={item[0]} count={item[1]} countPercentage={countPercentage} />);
});

return (
Expand Down

0 comments on commit f22f5c4

Please sign in to comment.