From bc541fc605c35fa9351af13fc7310f81f29eaa4d Mon Sep 17 00:00:00 2001 From: cfngc4594 Date: Thu, 20 Mar 2025 15:46:09 +0800 Subject: [PATCH] refactor(header): convert default exports to named exports for buttons and language selector --- .../workspace/editor/components/copy-button.tsx | 2 +- .../workspace/editor/components/format-button.tsx | 2 +- .../workspace/editor/components/header.tsx | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/features/playground/workspace/editor/components/copy-button.tsx b/src/components/features/playground/workspace/editor/components/copy-button.tsx index 029a8e1..91de795 100644 --- a/src/components/features/playground/workspace/editor/components/copy-button.tsx +++ b/src/components/features/playground/workspace/editor/components/copy-button.tsx @@ -12,7 +12,7 @@ import { Check, Copy } from "lucide-react"; import { Button } from "@/components/ui/button"; import { useProblemEditor } from "@/hooks/use-problem-editor"; -export default function CopyButton() { +export function CopyButton() { const { editor } = useProblemEditor(); const [copied, setCopied] = useState(false); diff --git a/src/components/features/playground/workspace/editor/components/format-button.tsx b/src/components/features/playground/workspace/editor/components/format-button.tsx index 5dd2f33..0b2b7fb 100644 --- a/src/components/features/playground/workspace/editor/components/format-button.tsx +++ b/src/components/features/playground/workspace/editor/components/format-button.tsx @@ -10,7 +10,7 @@ import { Paintbrush } from "lucide-react"; import { Button } from "@/components/ui/button"; import { useProblemEditor } from "@/hooks/use-problem-editor"; -export default function FormatButton() { +export function FormatButton() { const { editor } = useProblemEditor(); return ( diff --git a/src/components/features/playground/workspace/editor/components/header.tsx b/src/components/features/playground/workspace/editor/components/header.tsx index 9cd4e03..8c3a6b5 100644 --- a/src/components/features/playground/workspace/editor/components/header.tsx +++ b/src/components/features/playground/workspace/editor/components/header.tsx @@ -1,16 +1,16 @@ import { cn } from "@/lib/utils"; -import CopyButton from "./copy-button"; -import RedoButton from "./redo-button"; -import UndoButton from "./undo-button"; -import ResetButton from "./reset-button"; -import FormatButton from "./format-button"; -import LanguageSelector from "./language-selector"; +import { CopyButton } from "./copy-button"; +import { RedoButton } from "./redo-button"; +import { UndoButton } from "./undo-button"; +import { ResetButton } from "./reset-button"; +import { FormatButton } from "./format-button"; +import { LanguageSelector } from "./language-selector"; interface WorkspaceEditorHeaderProps { className?: string; } -export default function WorkspaceEditorHeader({ +export function WorkspaceEditorHeader({ className, ...props }: WorkspaceEditorHeaderProps) {