QuickAppBuilder / lib /utils.ts
PeterPinetree's picture
branding: centralize brand name/logo; update metadata, headers, nav, ask-ai UI, uploader, space placeholder, and injected badge to use BRAND_NAME/BRAND_ICON_SRC
bd69b27
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
export const COLORS = [
"red",
"blue",
"green",
"yellow",
"purple",
"pink",
"gray",
];
import { BRAND_ICON_SRC, BRAND_NAME } from "@/lib/branding";
export const getPTag = (repoId: string) => {
// Try to resolve absolute URL for icon based on current location when available
const origin = typeof window !== "undefined" ? window.location.origin : "";
const icon = BRAND_ICON_SRC.startsWith("http")
? BRAND_ICON_SRC
: `${origin}${BRAND_ICON_SRC}`;
const home = origin || "https://deepsite.hf.co";
return `<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="${icon}" alt="${BRAND_NAME} Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="${home}" style="color: #fff;text-decoration: underline;" target="_blank" >${BRAND_NAME}</a> - 🧬 <a href="${home}?remix=${repoId}" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p>`;
};