import { useTranslation } from "react-i18next"; import { I18nKey } from "#/i18n/declaration"; import { SettingsInput } from "../settings-input"; import { GitHubTokenHelpAnchor } from "./github-token-help-anchor"; import { KeyStatusIcon } from "../key-status-icon"; interface GitHubTokenInputProps { onChange: (value: string) => void; onGitHubHostChange: (value: string) => void; isGitHubTokenSet: boolean; name: string; githubHostSet: string | null | undefined; } export function GitHubTokenInput({ onChange, onGitHubHostChange, isGitHubTokenSet, name, githubHostSet, }: GitHubTokenInputProps) { const { t } = useTranslation(); return (
" : ""} startContent={ isGitHubTokenSet && ( ) } /> {})} name="github-host-input" testId="github-host-input" label={t(I18nKey.GITHUB$HOST_LABEL)} type="text" className="w-full max-w-[680px]" placeholder="github.com" defaultValue={githubHostSet || undefined} startContent={ githubHostSet && githubHostSet.trim() !== "" && ( ) } />
); }