import styled from '@emotion/styled'; import Textarea from 'sentry/components/forms/controls/textarea'; import Field from 'sentry/components/forms/field'; import FieldHelp from 'sentry/components/forms/field/fieldHelp'; import TextCopyInput from 'sentry/components/forms/textCopyInput'; import Input from 'sentry/components/input'; import {t} from 'sentry/locale'; import space from 'sentry/styles/space'; import {Relay} from 'sentry/types'; type FormField = keyof Pick; type Values = Record; type Props = { disables: Partial>; errors: Partial; isFormValid: boolean; onChange: (field: FormField, value: string) => void; onSave: () => void; onValidate: (field: FormField) => () => void; onValidateKey: () => void; values: Values; }; const Form = ({ values, onChange, errors, onValidate, isFormValid, disables, onValidateKey, onSave, }: Props) => { const handleChange = (field: FormField) => ( event: React.ChangeEvent | React.ChangeEvent ) => { onChange(field, event.target.value); }; const handleSubmit = () => { if (isFormValid) { onSave(); } }; // code below copied from app/views/organizationIntegrations/SplitInstallationIdModal.tsx // TODO: fix the common method selectText const onCopy = (value: string) => async () => // This hack is needed because the normal copying methods with TextCopyInput do not work correctly await navigator.clipboard.writeText(value); return (
{disables.publicKey ? ( {values.publicKey} ) : ( {t( 'Only enter the Public Key value from your credentials file. Never share the Secret key with Sentry or any third party' )} )}