change file imports and use ItemId for keys

This commit is contained in:
dkanada
2026-03-14 21:32:22 +09:00
parent a6bd2e55e9
commit 6e98fd2119
2 changed files with 8 additions and 7 deletions
@@ -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}
+4 -4
View File
@@ -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 = [];