import { css } from '@emotion/css'; import React, { FormEvent } from 'react'; import { Button, FileUpload, stylesFactory } from '@grafana/ui'; interface Props { isUploading: boolean; title?: string; onFileUpload: (event: FormEvent) => void; isDisabled?: boolean; licensedUrl?: string; } export const LicenseTokenUpload = ({ isUploading, title, onFileUpload, isDisabled, licensedUrl }: Props) => { const styles = getStyles(); return ( <> {title &&

{title}

} {isUploading ? ( ) : isDisabled ? ( ) : ( Upload a new token )} {licensedUrl && (

Instance URL: {licensedUrl}

)} ); }; const getStyles = stylesFactory(() => { return { title: css` margin-top: 30px; margin-bottom: 20px; `, instanceUrl: css` margin-top: 10px; `, }; });