import { env } from "@/env.mjs" import { ClassValue, clsx } from "clsx" import { twMerge } from "tailwind-merge" // tailwindcss classnames generator from shadcn export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)) } // changes the default size of the image to be fetched export function getImageURL(hashId: string, size: string): string { const IGDB_IMG_BASE_URL = env.IGDB_IMG_BASE_URL ?? '' return `${IGDB_IMG_BASE_URL}/t_${size}/${hashId}.jpg` } // calculates the offset for the query export function calculateOffset(page: number, limit: number): number { return (page - 1) * limit }