mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Initialize the data pipeline canvas. #9869 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
33 lines
767 B
TypeScript
33 lines
767 B
TypeScript
import {
|
|
FormControl,
|
|
FormField,
|
|
FormItem,
|
|
FormLabel,
|
|
FormMessage,
|
|
} from '@/components/ui/form';
|
|
import { Input } from '@/components/ui/input';
|
|
import { t } from 'i18next';
|
|
import { useFormContext } from 'react-hook-form';
|
|
|
|
interface IApiKeyFieldProps {
|
|
placeholder?: string;
|
|
}
|
|
export function ApiKeyField({ placeholder }: IApiKeyFieldProps) {
|
|
const form = useFormContext();
|
|
return (
|
|
<FormField
|
|
control={form.control}
|
|
name="api_key"
|
|
render={({ field }) => (
|
|
<FormItem>
|
|
<FormLabel>{t('flow.apiKey')}</FormLabel>
|
|
<FormControl>
|
|
<Input type="password" {...field} placeholder={placeholder}></Input>
|
|
</FormControl>
|
|
<FormMessage />
|
|
</FormItem>
|
|
)}
|
|
/>
|
|
);
|
|
}
|