mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-23 16:42:19 +00:00
* fix(sftp): preserve successful uploads with backup cleanup warnings Warn only on confirmed backup cleanup permission refusal after final publication. Preserve actionable warnings across transfer events, history restoration and completion ordering without masking deletion or commit failures. Narrow follow-up to #3830; related #3879. * fix(sftp): retain folder cleanup warnings before child completion
22 lines
1.0 KiB
TypeScript
22 lines
1.0 KiB
TypeScript
import { AlertTriangle } from "lucide-react";
|
|
import React from "react";
|
|
import { cn } from "../../lib/utils";
|
|
import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip";
|
|
|
|
/** Cleanup warnings are not transfer errors: retain the completed lifecycle. */
|
|
export function SftpTransferWarning({ warning, compact = false }: { warning?: string; compact?: boolean }) {
|
|
if (!warning) return null;
|
|
const content = (
|
|
<span className={cn("flex min-w-0 items-start gap-1 text-[10px] text-amber-600 dark:text-amber-400", !compact && "select-text")} data-section="sftp-transfer-warning">
|
|
<AlertTriangle size={12} className="mt-0.5 shrink-0" aria-hidden="true" />
|
|
<span className={compact ? "truncate" : "break-all"}>{warning}</span>
|
|
</span>
|
|
);
|
|
return compact ? (
|
|
<Tooltip>
|
|
<TooltipTrigger asChild><span className="block min-w-0" tabIndex={0}>{content}</span></TooltipTrigger>
|
|
<TooltipContent className="max-w-md select-text break-all">{warning}</TooltipContent>
|
|
</Tooltip>
|
|
) : content;
|
|
}
|