"use client"
import { Brain, X } from "lucide-react"
import { motion } from "motion/react"
import { dmSans125ClassName, dmSansClassName } from "@/lib/fonts"
import { useSpaceProfile } from "@/hooks/use-space-profile"
import { cn } from "@lib/utils"
type SpaceProfilePanelProps = {
containerTag: string
isOpen: boolean
onClose: () => void
}
type SpaceProfileContentProps = {
containerTag: string
onClose?: () => void
}
function CountBadge({ children }: { children: React.ReactNode }) {
return (
{children}
)
}
function LoadingState() {
return (
{Array.from({ length: 5 }).map((_, index) => (
))}
)
}
function EmptyState() {
return (
No profile yet
Add more memories and Nova will learn about this space.
)
}
function ProfileSection({ label, items }: { label: string; items: string[] }) {
if (items.length === 0) return null
return (
{label}
{items.length}
{items.map((item, index) => (
))}
)
}
export function SpaceProfileContent({
containerTag,
onClose,
}: SpaceProfileContentProps) {
const { data, isLoading, error } = useSpaceProfile(containerTag)
const keyFacts = data?.static ?? []
const recentContext = data?.dynamic ?? []
const totalCount = keyFacts.length + recentContext.length
return (
Space Profile
What Nova knows in this space
{onClose ? (
) : null}
{isLoading ? (
) : error ? (
Failed to load space profile.
) : totalCount === 0 ? (
) : (
)}
)
}
export function SpaceProfilePanel({
containerTag,
isOpen,
onClose,
}: SpaceProfilePanelProps) {
if (!isOpen) return null
return (
)
}