mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-06-10 09:25:57 +00:00
5b81588b87
* fix(frontend): fallback streamdown clipboard copy * fix(frontend): address clipboard fallback review * fix(frontend): normalize clipboard fallback rejection * fix(frontend): harden clipboard fallback install * fix(frontend): clarify clipboard fallback errors * fix(frontend): cover clipboard fallback edge cases * fix(frontend): tighten clipboard fallback cleanup * fix(frontend): reduce clipboard fallback copy window * fix(frontend): guard clipboard item fallback install * fix(frontend): clean up clipboard fallback on selection errors * Address clipboard fallback review feedback * fix(frontend): guard clipboard fallback install during SSR
18 lines
497 B
TypeScript
18 lines
497 B
TypeScript
"use client";
|
|
|
|
import { type ComponentProps } from "react";
|
|
import { Streamdown } from "streamdown";
|
|
|
|
import { installClipboardFallback } from "@/core/clipboard";
|
|
|
|
export type ClipboardSafeStreamdownProps = ComponentProps<typeof Streamdown>;
|
|
|
|
// Only patch browser globals in client context; skip during SSR
|
|
if (typeof document !== "undefined") {
|
|
installClipboardFallback();
|
|
}
|
|
|
|
export function ClipboardSafeStreamdown(props: ClipboardSafeStreamdownProps) {
|
|
return <Streamdown {...props} />;
|
|
}
|