Files
eosphoros-ai--db-gpt/web/components/database/form-dialog.tsx
T
wehub-resource-sync d13100ebf3
Update draft releases / main (push) Has been cancelled
Build and push docs image / build-image (push) Has been cancelled
Build Web Application / build-web (macos-latest) (push) Has been cancelled
Build Web Application / build-web (ubuntu-latest) (push) Has been cancelled
Python Code Quality Checks / build (push) Has been cancelled
Test Python / test-python (macos-latest, 3.10) (push) Has been cancelled
Test Python / test-python (macos-latest, 3.11) (push) Has been cancelled
Test Python / test-python (ubuntu-latest, 3.10) (push) Has been cancelled
Test Python / test-python (ubuntu-latest, 3.11) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:27:08 +08:00

57 lines
1.2 KiB
TypeScript

import { ConfigurableParams } from '@/types/common';
import { DBOption, DBType } from '@/types/db';
import { Modal } from 'antd';
import { useTranslation } from 'react-i18next';
import DatabaseForm from './database-form';
interface NewFormDialogProps {
open: boolean;
onClose: () => void;
onSuccess: () => void;
dbTypeList: DBOption[];
editValue?: string;
choiceDBType?: DBType;
getFromRenderData?: ConfigurableParams[];
dbNames?: string[];
dbTypeData?: DBOption[];
description?: string;
}
function FormDialog({
open,
onClose,
onSuccess,
dbTypeList,
editValue,
choiceDBType,
getFromRenderData,
dbNames,
description,
}: NewFormDialogProps) {
const { t } = useTranslation();
return (
<Modal
title={t(editValue ? 'edit_database' : 'add_database')}
open={open}
onCancel={onClose}
footer={null}
width={800}
destroyOnClose
>
<DatabaseForm
onCancel={onClose}
onSuccess={onSuccess}
dbTypeList={dbTypeList}
editValue={editValue}
choiceDBType={choiceDBType}
getFromRenderData={getFromRenderData}
dbNames={dbNames}
description={description}
/>
</Modal>
);
}
export default FormDialog;