Skip to content

Commit

Permalink
addressing coderabbit review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitakinger committed Jan 9, 2025
1 parent 7c30ebe commit b62fecb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ const items = [
export const ListStory = ListTemplate.bind({}) as StoryObj;
ListStory.storyName = "List";
ListStory.args = {
children: items.map((item, index) => (
<ListItem key={index} {...item} onClick={() => alert("Clicked")} />
children: items.map((item) => (
<ListItem
key={`item-${item.title}`}
{...item}
onClick={() => alert("Clicked")}
/>
)),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ const EntityGroup = <T,>({ group }: { group: EntityGroupProps<T> }) => {
key={group.groupTitle}
>
<List className={group.className} groupTitle={group.groupTitle}>
{updatedGroup.items.map((item: T) =>
{updatedGroup.items.map((item: T, index) =>
group.renderList ? (
group.renderList(item)
) : (
<ListItem
key={(item as ListItemProps)?.title}
key={(item as ListItemProps)?.title || `item-${index}`}
{...(item as ListItemProps)}
/>
),
Expand Down

0 comments on commit b62fecb

Please sign in to comment.