PluginProbe
Code Snippets / trunk
Code Snippets vtrunk
4.0.0-beta.2 3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 All 65 releases
code-snippets / js / components / FeedbackReporter / ReporterFields.tsx

ReporterFields.tsx in Code Snippets trunk, at js/components/FeedbackReporter/ReporterFields.tsx

39 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import React from 'react'
2 import { TextControl } from '@wordpress/components'
3 import { __ } from '@wordpress/i18n'
4 import { EnvironmentDisclosure } from './EnvironmentDisclosure'
5 import type { FeedbackConfig, FeedbackDraft } from '../../types/Feedback'
6
7 export interface ReporterFieldsProps {
8 config: FeedbackConfig
9 draft: FeedbackDraft
10 updateDraft: (changes: Partial<FeedbackDraft>) => void
11 }
12
13 export const ReporterFields: React.FC<ReporterFieldsProps> = ({ config, draft, updateDraft }) =>
14 <>
15 <div className="code-snippets-feedback-field">
16 <TextControl
17 label={__('Your name', 'code-snippets')}
18 help={__('Credited on the issue.', 'code-snippets')}
19 value={draft.name}
20 onChange={name => updateDraft({ name })}
21 />
22 </div>
23
24 <div className="code-snippets-feedback-field">
25 <TextControl
26 type="email"
27 label={__('Email for follow-up', 'code-snippets')}
28 help={__('Never published.', 'code-snippets')}
29 value={draft.email}
30 onChange={email => updateDraft({ email })}
31 />
32 </div>
33
34 <EnvironmentDisclosure
35 summary={config.summary}
36 errorCount={(window.codeSnippetsErrors ?? []).length}
37 />
38 </>
39