import React from "react"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { Copy, Download, Play } from "lucide-react"; import { toast } from "sonner"; interface CodeEditorProps { code: string; language?: string; onChange?: (code: string) => void; onRun?: () => void; } export function CodeEditor({ code, language = "python", onChange, onRun }: CodeEditorProps) { const copyToClipboard = () => { navigator.clipboard.writeText(code); toast.success("Code copied to clipboard!"); }; return ( {language} Editor
{onRun && ( )}