Files
cc-switch/src/components/AddProviderModal.tsx

38 lines
817 B
TypeScript
Raw Normal View History

import React from "react";
import { useTranslation } from "react-i18next";
import { Provider } from "../types";
import { AppType } from "../lib/tauri-api";
import ProviderForm from "./ProviderForm";
2025-08-04 22:16:26 +08:00
interface AddProviderModalProps {
appType: AppType;
onAdd: (provider: Omit<Provider, "id">) => void;
onClose: () => void;
2025-08-04 22:16:26 +08:00
}
const AddProviderModal: React.FC<AddProviderModalProps> = ({
appType,
onAdd,
onClose,
}) => {
const { t } = useTranslation();
const title =
appType === "claude"
? t("provider.addClaudeProvider")
: t("provider.addCodexProvider");
2025-08-04 22:16:26 +08:00
return (
<ProviderForm
appType={appType}
title={title}
submitText={t("common.add")}
showPresets={true}
onSubmit={onAdd}
onClose={onClose}
/>
);
};
2025-08-04 22:16:26 +08:00
export default AddProviderModal;