"use client" import { cn } from "@lib/utils" import { formatDistanceToNow } from "date-fns" import { ChevronRight } from "lucide-react" import { skillOriginLabel } from "@/components/settings/company-brain-skills/domain" import type { BrainSkill } from "@/hooks/use-brain-skills" import { dmSans125ClassName } from "@/lib/fonts" function updatedLabel(updatedAt: number) { const date = new Date(updatedAt) if (Number.isNaN(date.getTime())) return null return formatDistanceToNow(date, { addSuffix: true }) } function ScopeBadge({ scope }: { scope: BrainSkill["scope"] }) { return ( {scope === "org" ? "Org-wide" : "Personal"} ) } function OriginBadge({ origin }: { origin: BrainSkill["origin"] }) { const label = skillOriginLabel(origin) if (!label) return null return ( {label} ) } export function SkillRow({ skill, onOpen, }: { skill: BrainSkill onOpen: () => void }) { const updated = updatedLabel(skill.updatedAt) return ( ) }