mirror of
https://github.com/Jellify-Music/App.git
synced 2026-02-04 17:38:31 -06:00
10 lines
550 B
TypeScript
10 lines
550 B
TypeScript
import { useQuery } from "@tanstack/react-query";
|
|
import { QueryKeys } from "../../enums/query-keys";
|
|
import { Api } from "@jellyfin/sdk";
|
|
import { fetchItemImage } from "./functions/images";
|
|
import { ImageType } from "@jellyfin/sdk/lib/generated-client/models";
|
|
|
|
export const useItemImage = (api: Api, itemId: string, imageType?: ImageType, width?: number) => useQuery({
|
|
queryKey: [QueryKeys.ItemImage, api, itemId, imageType, width],
|
|
queryFn: ({ queryKey }) => fetchItemImage(queryKey[1] as Api, queryKey[2] as string, imageType, width)
|
|
}); |