Some checks failed
Deploy to Cloudflare Workers / deploy (push) Has been cancelled
25 lines
721 B
TypeScript
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"];
|