first commit

This commit is contained in:
Beyhan Oğur
2026-04-26 22:16:43 +03:00
commit 6d95e27114
97 changed files with 15687 additions and 0 deletions

15
lib/utils.ts Normal file
View File

@@ -0,0 +1,15 @@
import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
/** Backend'den gelen avatar_url tam veya relative olabilir; görüntülenebilir URL döner. */
export function getAvatarUrl(avatarUrl: string | undefined): string | undefined {
if (!avatarUrl) return undefined
if (avatarUrl.startsWith("http://") || avatarUrl.startsWith("https://")) return avatarUrl
const base = process.env.NEXT_PUBLIC_API_BASE || ""
const normalized = base.replace(/\/$/, "")
return `${normalized}${avatarUrl.startsWith("/") ? "" : "/"}${avatarUrl}`
}