11import { CONFIG } from "@/config/config" ;
22import { ArtifactFile } from "@/entities/artifacts/ui/artifact-file" ;
33import { NodeEvents } from "@/entities/events/ui/node-details-events" ;
4- import { useObjectDetails } from "@/entities/nodes/hooks/useObjectDetails " ;
4+ import { useGetObject } from "@/entities/nodes/object/domain/get-object.query " ;
55import { NodeDescription } from "@/entities/nodes/object/ui/node-description" ;
66import { ModelSchema } from "@/entities/schema/types" ;
7+ import { CoreArtifact } from "@/shared/api/graphql/generated/graphql" ;
78import ErrorScreen from "@/shared/components/errors/error-screen" ;
8- import NoDataFound from "@/shared/components/errors/no-data-found" ;
99import Content from "@/shared/components/layout/content" ;
1010import { LoadingIndicator } from "@/shared/components/loading/loading-indicator" ;
1111import { Card } from "@/shared/components/ui/card" ;
@@ -19,20 +19,20 @@ export interface ArtifactsDetailsProps {
1919
2020export function ArtifactsDetails ( { artifactId, artifactSchema } : ArtifactsDetailsProps ) {
2121 const artifactKind = artifactSchema . kind as string ;
22- const { loading, error, data } = useObjectDetails ( artifactSchema , artifactId ) ;
22+ const { isPending, error, data } = useGetObject ( {
23+ objectSchema : artifactSchema ,
24+ objectId : artifactId ,
25+ } ) ;
2326
24- if ( loading ) {
27+ if ( isPending ) {
2528 return < LoadingIndicator className = "h-full" /> ;
2629 }
2730
2831 if ( error ) {
29- return < ErrorScreen message = { `Something went wrong when fetching artifact ${ artifactId } ` } /> ;
32+ return < ErrorScreen message = { error . message } /> ;
3033 }
3134
32- const objectDetailsData = data ?. [ artifactKind ] ?. edges ?. [ 0 ] ?. node ;
33- if ( ! objectDetailsData ) {
34- return < NoDataFound message = { `No artifact found with id ${ artifactId } ` } /> ;
35- }
35+ const objectDetailsData = data as unknown as CoreArtifact ;
3636
3737 const fileUrl : string = CONFIG . ARTIFACTS_CONTENT_URL ( objectDetailsData ?. storage_id ?. value ) ;
3838 const contentType = objectDetailsData . content_type ?. value ;
0 commit comments