+ {copied ? (
+ Copied!
+ ) : (
+
+
+ Copy As Single Line
+
+ )}
+
+ );
+}
diff --git a/app/components/JsonPreview.tsx b/app/components/JsonPreview.tsx
index 3ec1d459..f8db7979 100644
--- a/app/components/JsonPreview.tsx
+++ b/app/components/JsonPreview.tsx
@@ -17,6 +17,7 @@ import { CopyTextButton } from "./CopyTextButton";
import { useTheme } from "./ThemeProvider";
import {usePreferences} from '~/components/PreferencesProvider';
import { useHotkeys } from "react-hotkeys-hook";
+import { CopySingleLineTextButton } from './CopySingleLineTextButton';
export type JsonPreviewProps = {
json: unknown;
@@ -31,6 +32,10 @@ export function JsonPreview({ json, highlightPath }: JsonPreviewProps) {
return jsonMap.stringify(json, null, preferences?.indent || 2);
}, [json, preferences]);
+ const jsonMappedSingleLine = useMemo(() => {
+ return jsonMap.stringify(json);
+ }, [json]);
+
const lines: LineRange | undefined = useMemo(() => {
if (!highlightPath) {
return;
@@ -116,6 +121,10 @@ export function JsonPreview({ json, highlightPath }: JsonPreviewProps) {
hovering ? "opacity-100" : "opacity-0"
}`}
>
+