aboutsummaryrefslogtreecommitdiffstats
path: root/apps/mobile/lib/hooks.ts
blob: 38ecebea6b95bc721e762ca607c5c491e5e4015d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
import { ImageURISource } from "react-native";

import useAppSettings from "./settings";
import { buildApiHeaders } from "./utils";

export function useAssetUrl(assetId: string): ImageURISource {
  const { settings } = useAppSettings();
  return {
    uri: `${settings.address}/api/assets/${assetId}`,
    headers: buildApiHeaders(settings.apiKey, settings.customHeaders),
  };
}