import { Input as CInput, Password } from '@gpustack/core-ui'; import { useIntl } from '@umijs/max'; import { Form } from 'antd'; import { useFormContext } from '../config/form-context'; import { FormData } from '../config/types'; const ProviderConfigs = () => { const intl = useIntl(); const form = Form.useFormInstance(); const { providerFields } = useFormContext(); const renderLabel = (item: any) => { return item.label.locale ? intl.formatMessage({ id: item.label.text }) : item.label.text; }; const renderDescription = (item: any) => { return item.description ? item.description.locale ? intl.formatMessage({ id: item.description.text }) : item.description.text : undefined; }; return ( <> {providerFields && providerFields.length > 0 ? providerFields?.map((item) => { return ( {item.type === 'Input' && ( )} {item.type === 'Password' && ( )} ); }) : null} ); }; export default ProviderConfigs;