import { SelectDropdown } from '@automattic/components'; import { useI18n } from '@wordpress/react-i18n'; import { GitHubInstallationData, useGithubInstallationsQuery, } from '../../use-github-installations-query'; import './style.scss'; interface GitHubInstallationsDropdown { installations: GitHubInstallationData[]; onAddInstallation(): void; value?: GitHubInstallationData; onChange( value: GitHubInstallationData ): void; } export const GitHubInstallationsDropdown = ( { onAddInstallation, installations, value, onChange, }: GitHubInstallationsDropdown ) => { const { __ } = useI18n(); const { isFetching } = useGithubInstallationsQuery(); return ( { installations.map( ( installation ) => ( onChange( installation ) } > { installation.account_name } ) ) } { __( 'Add GitHub account' ) } ); };