@@ -227,8 +227,8 @@ export const ViewSwitcher: React.FC<ViewSwitcherProps> = ({
227227 < SelectValue placeholder = "Select view" />
228228 </ SelectTrigger >
229229 < SelectContent >
230- { schema . views . map ( view => (
231- < SelectItem key = { view . type } value = { view . type } >
230+ { schema . views . map ( ( view , index ) => (
231+ < SelectItem key = { ` ${ view . type } - ${ index } ` } value = { view . type } >
232232 { getViewLabel ( view ) }
233233 </ SelectItem >
234234 ) ) }
@@ -238,13 +238,13 @@ export const ViewSwitcher: React.FC<ViewSwitcherProps> = ({
238238
239239 { variant === 'buttons' && (
240240 < div className = { cn ( viewSwitcherList ( { orientation } ) ) } >
241- { schema . views . map ( view => {
241+ { schema . views . map ( ( view , index ) => {
242242 const isActive = view . type === currentView ;
243243 const Icon = getViewIcon ( view ) ;
244244
245245 return (
246246 < Button
247- key = { view . type }
247+ key = { ` ${ view . type } - ${ index } ` }
248248 type = "button"
249249 size = "sm"
250250 variant = { isActive ? 'secondary' : 'ghost' }
@@ -262,11 +262,11 @@ export const ViewSwitcher: React.FC<ViewSwitcherProps> = ({
262262 { variant === 'tabs' && (
263263 < Tabs value = { currentViewValue } onValueChange = { ( value ) => handleViewChange ( value as ViewType ) } >
264264 < TabsList className = { cn ( viewSwitcherTabsList ( { orientation } ) ) } >
265- { schema . views . map ( view => {
265+ { schema . views . map ( ( view , index ) => {
266266 const Icon = getViewIcon ( view ) ;
267267 return (
268268 < TabsTrigger
269- key = { view . type }
269+ key = { ` ${ view . type } - ${ index } ` }
270270 value = { view . type }
271271 className = { cn ( 'gap-2' , isVertical ? 'justify-start' : '' ) }
272272 >
0 commit comments