"use client"; import Link from "next/link"; import { Plug, HardDrive, Database, FileText } from "lucide-react"; import { AppShell } from "@/components/app-shell"; import { Card, CardContent } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { Skeleton } from "@/components/ui/skeleton"; import { useSkills, type Skill } from "@/lib/api/skills"; function formatSize(bytes: number | null) { if (bytes == null) return "—"; if (bytes < 1024) return `${bytes} B`; if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`; return `${(bytes / (1024 * 1024)).toFixed(1)} MB`; } function statusBadge(s: Skill) { if (s.not_in_db) { return לא סונכרן; } if (s.db_markdown_chars > 0 && s.disk_exists) { return מסונכרן; } if (s.db_markdown_chars > 0) { return DB בלבד; } return לא ידוע; } function SkillCard({ skill }: { skill: Skill }) { const fileCount = skill.file_inventory?.length ?? 0; return ( {skill.name || skill.slug} {skill.slug} {statusBadge(skill)} {fileCount} קבצים {(skill.db_markdown_chars / 1000).toFixed(1)}K תווים {formatSize(skill.disk_skill_md_bytes)} {skill.updated_at && ( עודכן: {new Date(skill.updated_at).toLocaleDateString("he-IL")} )} ); } export default function SkillsPage() { const { data, isPending, error } = useSkills(); return ( בית · מיומנויות מיומנויות Paperclip רשימת ה-skills המותקנים במערכת Paperclip ומצב הסנכרון שלהם בין ה-DB לדיסק. {error ? ( {error.message} ) : isPending ? ( {[...Array(6)].map((_, i) => ( ))} ) : data?.length === 0 ? ( ❦ אין skills מותקנים ) : ( {data?.map((s) => )} )} ); }
{skill.slug}
עודכן: {new Date(skill.updated_at).toLocaleDateString("he-IL")}
רשימת ה-skills המותקנים במערכת Paperclip ומצב הסנכרון שלהם בין ה-DB לדיסק.