Skip to content

Commit

Permalink
Added link to view Set of an image
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinreber committed Nov 12, 2024
1 parent e6ee2d3 commit 3b04bbc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/pages/ExploreImageDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,18 @@ const ExploreImageDetailsPageAccessor = () => {

<TabsContent value="info" className="flex-1 overflow-y-auto">
<div className="p-4 space-y-4">
{imageData.setId && (
<div className="space-y-1">
<h4 className="font-semibold">Set</h4>
<a
href={`/set/${imageData.setId}`}
className="text-sm text-blue-500 hover:text-blue-600 hover:underline"
>
View Set
</a>
</div>
)}

<div className="space-y-1">
<h4 className="font-semibold">Engine Model</h4>
<p className="italic text-sm">{imageData.model}</p>
Expand Down
2 changes: 2 additions & 0 deletions app/server/getImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export interface ImageData {
createdAt: Date;
comments: ImageComment[];
likes: ImageLike[];
setId: string | null;
}

export interface GetImageDataAPIResponse extends ImageData {
Expand Down Expand Up @@ -86,6 +87,7 @@ export const getImage = async (
userId: true,
},
},
setId: true,
},
});

Expand Down

0 comments on commit 3b04bbc

Please sign in to comment.