Spaces:
Running
Running
| export const REACTION_EMOJIS = ["β€οΈ", "π€©", "π", "π₯"] | |
| export const COMMUNITY_FILTER_OPTIONS = [ | |
| { | |
| label: "Most Liked", | |
| value: "likes", | |
| icon: "lucide:heart", | |
| iconColor: "text-red-500" | |
| }, | |
| { | |
| label: "New", | |
| value: "new", | |
| icon: "lucide:zap", | |
| iconColor: "text-yellow-500" | |
| } | |
| ]; | |
| export const MODELS_FILTER_OPTIONS = [ | |
| { | |
| label: "Hotest", | |
| value: "hotest", | |
| icon: "ph:fire-bold", | |
| iconColor: "text-orange-500" | |
| }, | |
| { | |
| label: "Newest", | |
| value: "newest", | |
| icon: "ph:clock-bold", | |
| iconColor: "text-blue-500" | |
| }, | |
| { | |
| label: "Most Liked", | |
| value: "likes", | |
| icon: "lucide:heart", | |
| iconColor: "text-red-500" | |
| }, | |
| ]; | |
| export const SIDEBAR_MENUS = [ { | |
| icon: "uim:cube", | |
| label: "Models", | |
| href: "/models", | |
| }, { | |
| icon: "solar:gallery-bold-duotone", | |
| label: "Gallery", | |
| href: "/gallery", | |
| }, { | |
| icon: "fluent:glance-horizontal-sparkles-16-filled", | |
| label: "Generate", | |
| href: "/generate", | |
| }] | |
| export const tokenIsAvailable = async (token: string) => { | |
| const userRequest = await fetch("https://huggingface.co/oauth/userinfo", { | |
| method: "GET", | |
| headers: { | |
| Authorization: `Bearer ${token}`, | |
| }, | |
| }) | |
| const user = await userRequest.clone().json().catch(() => ({})); | |
| return user?.sub ? user : null; | |
| } |