import { Database, Globe } from 'lucide-react'; import { FormikErrors } from 'formik'; import { PropsWithChildren } from 'react'; import { Button } from '@@/buttons'; import { SimpleForm } from './SimpleForm'; import { Values } from './types'; import { AdvancedForm } from './AdvancedForm'; import { RateLimits } from './RateLimits'; export function ImageConfigFieldset({ onRateLimit, children, autoComplete, values, errors, onChangeImage, setFieldValue, }: PropsWithChildren<{ values: Values; errors?: FormikErrors; autoComplete?: boolean; onRateLimit?: (limited?: boolean) => void; onChangeImage?: (name: string) => void; setFieldValue: (field: string, value: T) => void; }>) { const Component = values.useRegistry ? SimpleForm : AdvancedForm; return (
{values.useRegistry ? ( ) : ( )}
{children} {onRateLimit && values.useRegistry && ( )}
); }