'use client'; import { Photo, altTextForPhoto, doesPhotoNeedBlurCompatibility, shouldShowCameraDataForPhoto, shouldShowExifDataForPhoto, } from '.'; import SiteGrid from '@/components/SiteGrid'; import ImageLarge from '@/components/ImageLarge'; import { clsx } from 'clsx/lite'; import Link from 'next/link'; import { pathForPhoto, pathForPhotoShare } from '@/site/paths'; import PhotoTags from '@/tag/PhotoTags'; import ShareButton from '@/components/ShareButton'; import PhotoCamera from '../camera/PhotoCamera'; import { cameraFromPhoto } from '@/camera'; import PhotoFilmSimulation from '@/simulation/PhotoFilmSimulation'; import { sortTags } from '@/tag'; import DivDebugBaselineGrid from '@/components/DivDebugBaselineGrid'; import PhotoLink from './PhotoLink'; import { SHOULD_PREFETCH_ALL_LINKS } from '@/site/config'; import AdminPhotoMenuClient from '@/admin/AdminPhotoMenuClient'; import { RevalidatePhoto } from './InfinitePhotoScroll'; import { useRef } from 'react'; import useOnVisible from '@/utility/useOnVisible'; export default function PhotoLarge({ photo, primaryTag, priority, prefetch = SHOULD_PREFETCH_ALL_LINKS, prefetchRelatedLinks = SHOULD_PREFETCH_ALL_LINKS, revalidatePhoto, showCamera = true, showSimulation = true, shouldShareTag, shouldShareCamera, shouldShareSimulation, shouldScrollOnShare, onVisible, }: { photo: Photo primaryTag?: string priority?: boolean prefetch?: boolean prefetchRelatedLinks?: boolean revalidatePhoto?: RevalidatePhoto showCamera?: boolean showSimulation?: boolean shouldShareTag?: boolean shouldShareCamera?: boolean shouldShareSimulation?: boolean shouldScrollOnShare?: boolean onVisible?: () => void }) { const ref = useRef(null); const tags = sortTags(photo.tags, primaryTag); const camera = cameraFromPhoto(photo); const showCameraContent = showCamera && shouldShowCameraDataForPhoto(photo); const showTagsContent = tags.length > 0; const showExifContent = shouldShowExifDataForPhoto(photo); useOnVisible(ref, onVisible); return ( } contentSide={ {/* Meta */}
{photo.caption &&
{photo.caption}
} {(showCameraContent || showTagsContent) &&
{showCameraContent && } {showTagsContent && }
}
{/* EXIF Data */}
{showExifContent && <>
  • {photo.focalLengthFormatted} {photo.focalLengthIn35MmFormatFormatted && <> {' '} {photo.focalLengthIn35MmFormatFormatted} }
  • {photo.fNumberFormatted}
  • {photo.exposureTimeFormatted}
  • {photo.isoFormatted}
  • {photo.exposureCompensationFormatted ?? '0ev'}
{showSimulation && photo.filmSimulation && } }
{photo.takenAtNaiveFormatted}
} /> ); };