mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2026-09-03 03:50:02 +03:00
change file imports and use ItemId for keys
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import React, { type FC } from 'react';
|
||||
import { NameGuidPair, PersonKind } from '@jellyfin/sdk/lib/generated-client';
|
||||
import { BaseItemDto } from '@jellyfin/sdk/lib/generated-client/models/base-item-dto';
|
||||
import type { BaseItemDto } from '@jellyfin/sdk/lib/generated-client';
|
||||
import type { NameGuidPair } from '@jellyfin/sdk/lib/generated-client/models/name-guid-pair';
|
||||
import { PersonKind } from '@jellyfin/sdk/lib/generated-client/models/person-kind';
|
||||
import { BaseItemKind } from '@jellyfin/sdk/lib/generated-client/models/base-item-kind';
|
||||
import Box from '@mui/material/Box';
|
||||
import Typography from '@mui/material/Typography';
|
||||
@@ -32,7 +33,7 @@ const ItemDetailsMetadataList: FC<ItemDetailsMetadataListProps> = ({
|
||||
</Typography>
|
||||
<Box className='focuscontainer-x'>
|
||||
{items.map((metadataItem, index) => (
|
||||
<Box key={index} component='span'>
|
||||
<Box key={item.Id} component='span'>
|
||||
{index > 0 ? ', ' : ''}
|
||||
<LinkButton href={getLink(type, item, context, metadataItem)} className='button-link' style={{ color: 'inherit' }}>
|
||||
{metadataItem.Name}
|
||||
|
||||
@@ -992,9 +992,9 @@ function renderDetails(page, instance, item, apiClient, context) {
|
||||
|
||||
for (const type of metadataTypes) {
|
||||
const renderTarget = document.createElement('div');
|
||||
const unmount = renderComponent(ItemDetailsMetadataList, { type, item, context: inferContext(item) }, renderTarget);
|
||||
const unmountMethod = renderComponent(ItemDetailsMetadataList, { type, item, context: inferContext(item) }, renderTarget);
|
||||
|
||||
instance._unmount.push(unmount);
|
||||
instance._unmount.push(unmountMethod);
|
||||
itemDetailsGroup.appendChild(renderTarget);
|
||||
}
|
||||
}
|
||||
@@ -1816,8 +1816,8 @@ function ItemDetailPage() {
|
||||
}
|
||||
|
||||
function unmount(instance) {
|
||||
for (const unmount of instance._unmount) {
|
||||
unmount();
|
||||
for (const unmountMethod of instance._unmount) {
|
||||
unmountMethod();
|
||||
}
|
||||
|
||||
instance._unmount = [];
|
||||
|
||||
Reference in New Issue
Block a user