Files
Nitro-V3/src/components/room/widgets/furniture/FurnitureExternalImageView.tsx
T
simoleo89 019295226d Sweep targeted typecheck errors: 11 fixes across 9 files
- ProductImageUtility: 'CatalogPageMessageProductData.I' was clearly a
  placeholder/typo in the WALL branch — getProductCategory's first
  param is FurnitureType, so use the enclosing productType.
- YouTubePlayerView: IRoomUserData has webID, not userId. Two
  spectator/watcher-list sites used the wrong field.
- AvatarInfoWidgetView REQUEST_MANIPULATION handler: avatarInfo is
  IAvatarInfo (union); .category / .id only exist on AvatarInfoFurni.
  Type-guard before reading.
- InfoStandWidgetPetView: deleted the duplicate local 'interface
  AvatarInfoPet' — was shadowing the imported one. Drop AvatarInfoPet
  from the import (local interface stands alone).
- FurnitureExternalImageView: missing GetSessionDataManager import (the
  reportedUserId field reads it inline). Added.
- GroupCreatorView setGroupData call: null values for groupName /
  groupDescription / groupColors / groupBadgeParts where IGroupData
  expects string / number[] / GroupBadgePart[]. Empty defaults. Also
  added the previously-omitted groupHasForum field.
- ContextMenuView + WiredCreatorToolsView: 'return () =>
  ticker.remove(updateOverlays)' — Pixi Ticker.remove() returns the
  ticker, leaking the value to React's EffectCallback cleanup which
  expects 'void | (() => void)'. Wrap in block body.
- Deleted src/components/room/widgets/chat/ChatWidgetWindowView_old.tsx
  — dead code (zero references in the codebase), tripping the
  NitroCardHeaderView onCloseClick prop change.

Net tsgo error count: -11.
2026-05-11 21:34:34 +02:00

38 lines
1.8 KiB
TypeScript

import { FC } from 'react';
import { GetSessionDataManager } from '@nitrots/nitro-renderer';
import { GetConfigurationValue, LocalizeText, ReportType } from '../../../../api';
import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../../../common';
import { useFurnitureExternalImageWidget, useHelp } from '../../../../hooks';
import { CameraWidgetShowPhotoView } from '../../../camera/views/CameraWidgetShowPhotoView';
export const FurnitureExternalImageView: FC<{}> = props =>
{
const { objectId = -1, currentPhotoIndex = -1, currentPhotos = null, onClose = null } = useFurnitureExternalImageWidget();
const { report = null } = useHelp();
if (objectId === -1 || currentPhotoIndex === -1) return null;
const handleOpenFullPhoto = () =>
{
const photoUrl = currentPhotos[currentPhotoIndex].w.replace('_small.png', '.png');
if (photoUrl)
{
console.log('Opened photo URL:', photoUrl);
window.open(photoUrl, '_blank');
}
};
return (
<NitroCardView className="nitro-external-image-widget no-resize" uniqueKey="photo-viewer" theme="primary-slim">
<NitroCardHeaderView
headerText={ LocalizeText('camera.interface.title') }
isGalleryPhoto={true}
onCloseClick={onClose}
onReportPhoto={() => report(ReportType.PHOTO, { extraData: currentPhotos[currentPhotoIndex].w, roomId: currentPhotos[currentPhotoIndex].s, reportedUserId: GetSessionDataManager().userId, roomObjectId: Number(currentPhotos[currentPhotoIndex].u) })}
/>
<NitroCardContentView>
<CameraWidgetShowPhotoView currentIndex={currentPhotoIndex} currentPhotos={currentPhotos} onClick={handleOpenFullPhoto} />
</NitroCardContentView>
</NitroCardView>
);
};