Newer
Older
import { ClassValue, clsx } from "clsx"
import { twMerge } from "tailwind-merge"
// tailwindcss classnames generator from shadcn
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}

Yusuf Akgül
committed
const IGDB_IMG_BASE_URL = process.env.IGDB_IMG_BASE_URL ?? ''
// changes the default size of the image to be fetched
export function getImageURL(hashId: string, size: string): string {
return `${IGDB_IMG_BASE_URL}/t_${size}/${hashId}.jpg`

Yusuf Akgül
committed
}
// calculates the offset for the query
export function calculateOffset(page: number, limit: number): number {
return (page - 1) * limit