import Link from "next/link";
import { Clock, FileText } from "lucide-react";
import type { DocumentMeta } from "@mcpedia/types";
import { getSectionMeta } from "@mcpedia/config/sections";
export function DocumentCard({
doc,
showSection = false,
score,
}: {
doc: DocumentMeta;
showSection?: boolean;
score?: number;
}) {
const sInfo = getSectionMeta(doc.section);
return (
{doc.title}
{showSection && (
{sInfo.icon} {doc.section}
)}
{doc.tags.slice(0, 4).map((t: string) => (
#{t}
))}
{typeof score === "number" && (
{score.toFixed(3)}
)}
);
}
export function CompactDocCard({ doc, snippet, score }: { doc: DocumentMeta; snippet?: string; score?: number }) {
const sInfo = getSectionMeta(doc.section);
return (
{sInfo.icon} {doc.section}
/{doc.slug}
{typeof score === "number" && (
{score.toFixed(3)}
)}
{doc.title}
{snippet && (
)}
);
}