import { Link } from 'react-router'; import { AlbumsSection } from './AlbumsSection'; import { ConnectionSection } from './ConnectionSection'; import { ExploreSection } from './ExploreSection'; import { MapSection } from './MapSection'; import { PeopleSection } from './PeopleSection'; import { SearchSection } from './SearchSection'; import { SharingSection } from './SharingSection'; import { TimelineSection } from './TimelineSection'; import { photosSectionPath } from './shared'; import { usePhotosHealth } from './usePhotosData'; import { usePhotosSection } from './usePhotosSection'; // Right panel of the /photos workspace — renders the section named by the URL. // // Timeline, favorites, archive and trash are one component with a filter; the rest are their own. // // Health gates all of them, and its two failure modes are answered differently: nothing configured yet is // the setup form, whatever section was asked for, because there is nothing else useful to show; a stored // instance that is failing keeps its own message and a way back to the connection screen, since replacing a // working key by accident is worse than a wall of text. export const PhotosView = () => { const section = usePhotosSection(); const { data: health, isLoading } = usePhotosHealth(); if (section === 'settings') return ; if (!isLoading && health && !health.ok) { if (health.configured === false) return ; return (

Photos is not answering

{health.error ?? 'The photos sidecar could not reach the configured Immich instance.'}

Check the connection
); } switch (section) { case 'explore': return ; case 'map': return ; case 'search': return ; case 'albums': return ; case 'people': return ; case 'sharing': return ; case 'favorites': case 'archive': case 'trash': case 'timeline': default: return ; } };