PluginProbe
Code Snippets / 4.0.0-beta.2
Code Snippets v4.0.0-beta.2
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 / EnvironmentDisclosure.tsx

EnvironmentDisclosure.tsx in Code Snippets 4.0.0-beta.2, at js/components/FeedbackReporter/EnvironmentDisclosure.tsx

34 lines 1.2 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 { __, _n, sprintf } from '@wordpress/i18n'
3
4 export interface EnvironmentDisclosureProps {
5 summary: Record<string, string>
6 errorCount: number
7 }
8
9 export const EnvironmentDisclosure: React.FC<EnvironmentDisclosureProps> = ({ summary, errorCount }) =>
10 <details className="code-snippets-feedback-disclosure">
11 <summary>{__('What gets sent with this report', 'code-snippets')}</summary>
12
13 <dl className="code-snippets-feedback-disclosure__list">
14 {Object.entries(summary).map(([label, value]) =>
15 <React.Fragment key={label}>
16 <dt>{label}</dt>
17 <dd>{value}</dd>
18 </React.Fragment>
19 )}
20
21 <dt>{__('JavaScript errors', 'code-snippets')}</dt>
22 <dd>
23 {0 === errorCount
24 ? __('none on this page', 'code-snippets')
25 // translators: %d: number of JavaScript errors captured on the current page.
26 : sprintf(_n('%d error captured', '%d errors captured', errorCount, 'code-snippets'), errorCount)}
27 </dd>
28 </dl>
29
30 <p className="code-snippets-feedback-disclosure__note">
31 {__('Your site address, email address and full plugin list stay with the Code Snippets team. Only the report itself and the version numbers appear on the public issue tracker.', 'code-snippets')}
32 </p>
33 </details>
34