import { UseFormRegister } from 'react-hook-form'; import { Trans, t } from '@grafana/i18n'; import { Checkbox, ControlledCollapse, Field, Text, TextLink } from '@grafana/ui'; import { checkImageRenderer, checkPublicAccess } from '../GettingStarted/features'; import { GETTING_STARTED_URL } from '../constants'; import { RepositoryFormData } from '../types'; export interface ConfigFormGithubCollapseProps { register: UseFormRegister; } export function ConfigFormGithubCollapse({ register }: ConfigFormGithubCollapseProps) { const isPublic = checkPublicAccess(); const hasImageRenderer = checkImageRenderer(); return ( Adds an image preview of dashboard changes in pull requests. Images of your Grafana dashboards will be shared in your Git repository and visible to anyone with repository access. {' '} Requires image rendering.{' '} Set up image rendering } {...register('generateDashboardPreviews')} /> {!isPublic && ( Configure webhooks {' '} to get instant updates in Grafana as soon as changes are committed. Review and approve changes using pull requests before they go live. )} ); }