import React, { useEffect } from "react"; import { X, Save } from "lucide-react"; import { useTranslation } from "react-i18next"; import { isLinux } from "@/lib/platform"; interface CodexCommonConfigModalProps { isOpen: boolean; onClose: () => void; value: string; onChange: (value: string) => void; error?: string; } /** * CodexCommonConfigModal - Common Codex configuration editor modal * Allows editing of common TOML configuration shared across providers */ export const CodexCommonConfigModal: React.FC = ({ isOpen, onClose, value, onChange, error, }) => { const { t } = useTranslation(); // Support ESC key to close modal useEffect(() => { if (!isOpen) return; const onKeyDown = (e: KeyboardEvent) => { if (e.key === "Escape") { e.preventDefault(); onClose(); } }; window.addEventListener("keydown", onKeyDown); return () => window.removeEventListener("keydown", onKeyDown); }, [isOpen, onClose]); if (!isOpen) return null; return (
{ if (e.target === e.currentTarget) onClose(); }} > {/* Backdrop */}
{/* Modal */}
{/* Header */}

{t("codexConfig.editCommonConfigTitle")}

{/* Content */}

{t("codexConfig.commonConfigHint")}