import { Photo, shouldShowCameraDataForPhoto, shouldShowExifDataForPhoto, titleForPhoto, } 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 AdminPhotoMenu from '@/admin/AdminPhotoMenu'; import { Suspense } from 'react'; export default function PhotoLarge({ photo, primaryTag, priority, prefetch = false, prefetchRelatedLinks = false, showCamera = true, showSimulation = true, shouldShareTag, shouldShareCamera, shouldShareSimulation, shouldScrollOnShare, }: { photo: Photo primaryTag?: string priority?: boolean prefetch?: boolean prefetchRelatedLinks?: boolean showCamera?: boolean showSimulation?: boolean shouldShareTag?: boolean shouldShareCamera?: boolean shouldShareSimulation?: boolean shouldScrollOnShare?: boolean }) { const tags = sortTags(photo.tags, primaryTag); const camera = cameraFromPhoto(photo); const renderMiniGrid = (children: JSX.Element, rightPadding = true) =>
*]:sm:flex-grow', rightPadding && 'pr-2', )}> {children}
; return ( } contentSide={
{renderMiniGrid(<>
{titleForPhoto(photo)}
{tags.length > 0 && }
{showCamera && shouldShowCameraDataForPhoto(photo) &&
{showSimulation && photo.filmSimulation &&
}
} )} {renderMiniGrid(<> {shouldShowExifDataForPhoto(photo) &&
  • {photo.focalLengthFormatted} {photo.focalLengthIn35MmFormatFormatted && <> {' '} {photo.focalLengthIn35MmFormatFormatted} }
  • {photo.fNumberFormatted}
  • {photo.exposureTimeFormatted}
  • {photo.isoFormatted}
  • {photo.exposureCompensationFormatted ?? '—'}
}
{photo.takenAtNaiveFormatted}
, false)}
} /> ); };