'use client' import { Button } from '@langgenius/dify-ui/button' import * as React from 'react' import { useTranslation } from 'react-i18next' type SetURLProps = { repoUrl: string onChange: (value: string) => void onNext: () => void onCancel: () => void } const SetURL: React.FC = ({ repoUrl, onChange, onNext, onCancel }) => { const { t } = useTranslation() const inputRef = React.useRef(null) // Focus the input after the dropdown's focus-return animation settles. // Using rAF avoids racing the DropdownMenu FloatingFocusManager that returns // focus to the trigger on close. React.useEffect(() => { const frame = requestAnimationFrame(() => { inputRef.current?.focus() }) return () => cancelAnimationFrame(frame) }, []) return ( <> onChange(e.target.value)} className="shadows-shadow-xs flex grow items-center gap-[2px] self-stretch overflow-hidden rounded-lg border border-components-input-border-active bg-components-input-bg-active p-2 system-sm-regular text-ellipsis text-components-input-text-filled" placeholder="Please enter GitHub repo URL" />
) } export default SetURL