import * as shopify from '@shopify/lang-jsonc'; import { xcodeDark, xcodeLight } from '@uiw/codemirror-theme-xcode'; import CodeMirror from '@uiw/react-codemirror'; import { BookCopy, CircleX } from 'lucide-react'; import { useEffect, useState } from 'react'; import Merge from 'react-codemirror-merge'; import { ErrorBoundary } from 'react-error-boundary'; import { ClientOnly } from 'remix-utils/client-only'; import Fallback from './fallback'; interface EditorProps { isDisabled?: boolean; value: string; onChange: (value: string) => void; } // TODO: Remove ClientOnly export function Editor(props: EditorProps) { const [light, setLight] = useState(false); useEffect(() => { const theme = window.matchMedia('(prefers-color-scheme: light)'); setLight(theme.matches); theme.addEventListener('change', (theme) => { setLight(theme.matches); }); }); return (

Failed to load the editor.

} > }> {() => ( props.onChange(value)} /> )} ); } interface DifferProps { left: string; right: string; } export function Differ(props: DifferProps) { const [light, setLight] = useState(false); useEffect(() => { const theme = window.matchMedia('(prefers-color-scheme: light)'); setLight(theme.matches); theme.addEventListener('change', (theme) => { setLight(theme.matches); }); }); return (
{props.left === props.right ? (

No changes

) : (

Failed to load the editor.

} > }> {() => ( )}
)} ); }