Yaltopia-FIFA/lib/utils.ts
Kirubel-Kibru-Yaltopia 89440985f1
Some checks failed
Deploy to Cloudflare Workers / deploy (push) Has been cancelled
x
2026-05-24 21:46:10 +03:00

25 lines
721 B
TypeScript

import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
export function slugify(text: string): string {
return text
.toLowerCase()
.trim()
.replace(/[^\w\s-]/g, "")
.replace(/[\s_-]+/g, "-")
.replace(/^-+|-+$/g, "");
}
export function getTeamLogoUrl(logoPath: string | null | undefined): string | null {
if (!logoPath) return null;
const base = process.env.NEXT_PUBLIC_SUPABASE_URL;
if (!base) return null;
return `${base}/storage/v1/object/public/team-logos/${logoPath}`;
}
export const DAY_NAMES = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];