import { PropsWithChildren, ReactNode } from 'react';
import { SchemaOf, string } from 'yup';
import { useStateWrapper } from '@/react/hooks/useStateWrapper';
import { FormControl } from '@@/form-components/FormControl';
import { Input } from '@@/form-components/Input';
import { TextTip } from '@@/Tip/TextTip';
import { isBE } from '../../feature-flags/feature-flags.service';
import { RefSelector } from './RefSelector';
interface Props {
value: string;
onChange(value: string): void;
sourceId?: number;
error?: string;
}
export function RefField({ value, onChange, sourceId, error }: Props) {
const [inputValue, updateInputValue] = useStateWrapper(value, onChange);
const inputId = 'repository-reference-field';
return isBE ? (
refs/heads/branch_name or tags with{' '}
refs/tags/tag_name.
>
}
>
refs/heads/branch_name or tags with{' '}
refs/tags/tag_name. If not specified, will use the
default HEAD reference normally the main{' '}
branch.
>
}
>
updateInputValue(e.target.value)}
placeholder="refs/heads/main"
/>