mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
22 lines
630 B
TypeScript
22 lines
630 B
TypeScript
import React from "react";
|
|
import { useParams } from "react-router-dom";
|
|
import { StashService } from "src/core/StashService";
|
|
import { LoadingIndicator } from "src/components/Shared";
|
|
import { GalleryViewer } from "./GalleryViewer";
|
|
|
|
export const Gallery: React.FC = () => {
|
|
const { id = "" } = useParams();
|
|
|
|
const { data, error, loading } = StashService.useFindGallery(id);
|
|
const gallery = data?.findGallery;
|
|
|
|
if (loading || !gallery) return <LoadingIndicator />;
|
|
if (error) return <div>{error.message}</div>;
|
|
|
|
return (
|
|
<div className="col-9 m-auto">
|
|
<GalleryViewer gallery={gallery} />
|
|
</div>
|
|
);
|
|
};
|