"use client" import { useState } from "react" import { useAuth } from "@/contexts/auth-context" import { Card, CardContent } from "@/components/ui/card" import { Button } from "@/components/ui/button" import { Badge } from "@/components/ui/badge" import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" import { Heart, ExternalLink } from "lucide-react" // Favorite apps data - empty for production const mockFavoriteApps: any[] = [] export function FavoritesPage() { const { user } = useAuth() const [sortBy, setSortBy] = useState("name") const [filterDepartment, setFilterDepartment] = useState("all") const handleUseApp = (app: any) => { // Open app in new tab window.open(app.url, "_blank") console.log(`Opening app: ${app.name}`) } const filteredAndSortedApps = mockFavoriteApps .filter((app) => filterDepartment === "all" || app.department === filterDepartment) .sort((a, b) => { switch (sortBy) { case "name": return a.name.localeCompare(b.name) case "creator": return a.creator.localeCompare(b.creator) case "department": return a.department.localeCompare(b.department) default: return 0 } }) return (
{/* Filter and Sort Controls */}
共 {filteredAndSortedApps.length} 個收藏應用
{/* Favorites Grid */} {filteredAndSortedApps.length > 0 ? (
{filteredAndSortedApps.map((app) => ( {/* Header with heart icon */}

{app.name}

{/* Description */}

{app.description}

{/* Developer and Department */}
開發者: {app.creator} {app.department}
{/* Tags */}
{app.tags.map((tag, index) => ( {tag} ))}
{/* Action Button */}
))}
) : (

暫無收藏應用

{filterDepartment !== "all" ? "該部門暫無收藏的應用,請嘗試其他篩選條件" : "您還沒有收藏任何應用,快去探索並收藏您喜歡的 AI 應用吧!"}

)}
) }