chore: init monorepo snapshot

This commit is contained in:
liaibo
2025-11-23 10:55:04 +08:00
commit c70ff52869
941 changed files with 246586 additions and 0 deletions
@@ -0,0 +1,39 @@
import { Button } from "@/components/ui/button";
import type { DocumentSearchResult } from "@/types/search";
interface PageHoverCardProps {
result: DocumentSearchResult;
onPreview?: () => void;
}
const formatRelative = (value: string | null) => {
if (!value) return "未知时间";
const date = new Date(value);
return date.toLocaleString();
};
export function PageHoverCard({ result, onPreview }: PageHoverCardProps) {
return (
<div className="space-y-2 text-xs text-gray-600">
<div>
<p className="text-sm font-semibold text-gray-900">{result.title || "无标题"}</p>
<p className="text-[11px] text-gray-400">
{formatRelative(result.updatedAt)} · {formatRelative(result.createdAt)}
</p>
</div>
<div
className="line-clamp-4 rounded-lg bg-[#f8fafc] p-2 text-[11px] leading-relaxed text-gray-600"
dangerouslySetInnerHTML={{ __html: result.snippet }}
/>
<Button
type="button"
size="sm"
variant="outline"
className="w-full text-[11px]"
onClick={() => onPreview?.()}
>
</Button>
</div>
);
}