"use client"; import Link from "next/link"; import { AppShell } from "@/components/app-shell"; import { Card } from "@/components/ui/card"; import { Skeleton } from "@/components/ui/skeleton"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@/components/ui/table"; import { useSkills, type Skill } from "@/lib/api/skills"; import { formatIsoDate } from "@/lib/format-date"; function formatChars(skill: Skill): string { // Mockup column = "גודל (תווים)" — the DB markdown char count, grouped. const n = skill.db_markdown_chars ?? 0; return n.toLocaleString("en-US"); } function formatUpdated(iso: string | null): string { // ISO-style date to match the mockup (2026-06-09), tabular — Israel-time day. return formatIsoDate(iso); } /** * Sync chip — colored dot + label, faithful to mockup 14: * - מסונכרן (success) when present in DB + on disk * - DB בלבד (info) when in DB but no disk copy * - לא מסונכרן (warn) when missing from the DB */ function SyncChip({ skill }: { skill: Skill }) { let tone: { wrap: string; dot: string }; let label: string; if (skill.not_in_db) { tone = { wrap: "bg-warn-bg text-warn", dot: "bg-warn" }; label = "לא מסונכרן"; } else if (skill.db_markdown_chars > 0 && skill.disk_exists) { tone = { wrap: "bg-success-bg text-success", dot: "bg-success" }; label = "מסונכרן"; } else if (skill.db_markdown_chars > 0) { tone = { wrap: "bg-info-bg text-info", dot: "bg-info" }; label = "DB בלבד"; } else { tone = { wrap: "bg-rule-soft text-ink-muted", dot: "bg-ink-muted" }; label = "לא ידוע"; } return ( {label} ); } export default function SkillsPage() { const { data, isPending, error } = useSkills(); return (

מיומנויות

סקילים מותקנים בפלטפורמה — שם, גודל, מועד עדכון ומצב הסנכרון בין ה-DB לדיסק.

{error ? ( {error.message} ) : isPending ? ( ) : data?.length === 0 ? (
אין skills מותקנים
) : ( סלאג שם תצוגה גודל (תווים) עודכן סנכרון {data?.map((s) => ( {s.slug} {s.name || s.slug} {formatChars(s)} {formatUpdated(s.updated_at)} ))}
)}
); }