mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-09-24 15:49:09 +00:00
bd12dc663e
Truncate long snippet command tooltips, add drag-resize for inline host/group detail panels, and compact appearance override reset controls. Co-authored-by: Cursor <cursoragent@cursor.com>
30 lines
723 B
TypeScript
30 lines
723 B
TypeScript
import React from "react";
|
|
|
|
import { formatSnippetCommandTooltip } from "@/domain/snippetPreview";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
export function SnippetCommandTooltipContent({
|
|
label,
|
|
command,
|
|
className,
|
|
fallback,
|
|
}: {
|
|
label?: string;
|
|
command: string;
|
|
className?: string;
|
|
fallback?: string;
|
|
}) {
|
|
const preview = formatSnippetCommandTooltip(command);
|
|
|
|
return (
|
|
<div className={cn("max-w-sm", className)}>
|
|
{label ? (
|
|
<div className="mb-1 break-all text-xs font-medium">{label}</div>
|
|
) : null}
|
|
<pre className="max-h-36 overflow-hidden font-mono text-[11px] leading-snug whitespace-pre-wrap break-all">
|
|
{preview || fallback || "—"}
|
|
</pre>
|
|
</div>
|
|
);
|
|
}
|