mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-03 14:22:13 +08:00
refactor: move
This commit is contained in:
@@ -16,7 +16,6 @@ import {
|
||||
ArtifactHeader,
|
||||
ArtifactTitle,
|
||||
} from "@/components/ai-elements/artifact";
|
||||
import { CodeEditor } from "@/components/ai-elements/code-editor";
|
||||
import { Select, SelectItem } from "@/components/ui/select";
|
||||
import {
|
||||
SelectContent,
|
||||
@@ -25,6 +24,7 @@ import {
|
||||
SelectValue,
|
||||
} from "@/components/ui/select";
|
||||
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
|
||||
import { CodeEditor } from "@/components/workspace/code-editor";
|
||||
import { useArtifactContent } from "@/core/artifacts/hooks";
|
||||
import { urlOfArtifact } from "@/core/artifacts/utils";
|
||||
import { useI18n } from "@/core/i18n/hooks";
|
||||
|
||||
@@ -48,10 +48,7 @@ export function CodeEditor({
|
||||
autoFocus?: boolean;
|
||||
settings?: any;
|
||||
}) {
|
||||
const { theme = "system", systemTheme = "light" } = useTheme();
|
||||
|
||||
const currentTheme =
|
||||
theme === "system" ? systemTheme : (theme as "dark" | "light");
|
||||
const { resolvedTheme } = useTheme();
|
||||
|
||||
const extensions = useMemo(() => {
|
||||
return [
|
||||
@@ -81,7 +78,7 @@ export function CodeEditor({
|
||||
"h-full overflow-auto font-mono [&_.cm-editor]:h-full [&_.cm-focused]:outline-none!",
|
||||
"px-2 py-0! [&_.cm-line]:px-2! [&_.cm-line]:py-0!",
|
||||
)}
|
||||
theme={currentTheme === "dark" ? customDarkTheme : customLightTheme}
|
||||
theme={resolvedTheme === "dark" ? customDarkTheme : customLightTheme}
|
||||
extensions={extensions}
|
||||
basicSetup={{
|
||||
foldGutter: settings?.foldGutter ?? false,
|
||||
Reference in New Issue
Block a user