Files
lms-sb/src/components/tools/ToolCard.tsx
T
admins 6317dade9e Add Dataview and Bases generators (Toolbox Phase 2)
Two more inside-LMS generators under /tools, completing the 6-tool set:
- Dataview: DQL builder (TABLE/LIST/TASK/CALENDAR, FROM/WHERE/SORT/LIMIT),
  output wrapped in a dataview code block
- Bases: .base YAML builder (views, filters and:, order, sort, groupBy, limit);
  filter expressions emitted as single-quoted YAML scalars for safety

Syntax verified against official Obsidian docs (research workflow). Audit fix:
Bases sort entries use 'column:' (not 'property:') per documented working .base
files; 'property:' is kept only for groupBy. 14 new tests (47 total).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 10:04:09 +05:00

27 lines
995 B
TypeScript

import Link from "next/link";
import { MessageSquareQuote, FileCode2, Palette, SlidersHorizontal, Table2, Database, Wrench, type LucideIcon } from "lucide-react";
import type { ToolMeta } from "@/lib/tools/_shared/types";
// Явная карта (не `import * as Icons`) — иначе весь набор lucide попадает в бандл.
const ICONS: Record<string, LucideIcon> = {
MessageSquareQuote,
FileCode2,
Palette,
SlidersHorizontal,
Table2,
Database,
};
export function ToolCard({ tool }: { tool: ToolMeta }) {
const Icon = ICONS[tool.icon] ?? Wrench;
return (
<Link href={`/tools/${tool.id}`} className="card-aubade p-4 flex flex-col gap-2 no-underline">
<div className="flex items-center gap-2" style={{ color: "var(--foreground)" }}>
<Icon size={20} />
<span className="font-bold">{tool.title}</span>
</div>
<p className="text-sm" style={{ color: "var(--muted-foreground)" }}>{tool.description}</p>
</Link>
);
}