| 1 |
import React from 'react' |
| 2 |
import { CheckboxControl, TextareaControl } from '@wordpress/components' |
| 3 |
import { __ } from '@wordpress/i18n' |
| 4 |
import type { FeedbackDraft } from '../../types/Feedback' |
| 5 |
|
| 6 |
export interface BugDetailFieldsProps { |
| 7 |
draft: FeedbackDraft |
| 8 |
updateDraft: (changes: Partial<FeedbackDraft>) => void |
| 9 |
} |
| 10 |
|
| 11 |
export const BugDetailFields: React.FC<BugDetailFieldsProps> = ({ draft, updateDraft }) => |
| 12 |
<> |
| 13 |
<div className="code-snippets-feedback-field"> |
| 14 |
<TextareaControl |
| 15 |
label={__('Steps to reproduce', 'code-snippets')} |
| 16 |
rows={5} |
| 17 |
value={draft.steps} |
| 18 |
placeholder={__('1. Open a saved snippet\n2. Click the Conditions tab\n3. Switch back to Code', 'code-snippets')} |
| 19 |
onChange={steps => updateDraft({ steps })} |
| 20 |
/> |
| 21 |
</div> |
| 22 |
|
| 23 |
<fieldset className="code-snippets-feedback-fieldset"> |
| 24 |
<legend>{__('Isolating the problem', 'code-snippets')}</legend> |
| 25 |
|
| 26 |
<CheckboxControl |
| 27 |
label={__('This happens with only Code Snippets active', 'code-snippets')} |
| 28 |
checked={draft.isolation.plugin_only} |
| 29 |
onChange={pluginOnly => updateDraft({ isolation: { ...draft.isolation, plugin_only: pluginOnly } })} |
| 30 |
/> |
| 31 |
|
| 32 |
<CheckboxControl |
| 33 |
label={__('This happens with a blank theme active, such as Twenty Twenty-Five', 'code-snippets')} |
| 34 |
checked={draft.isolation.blank_theme} |
| 35 |
onChange={blankTheme => updateDraft({ isolation: { ...draft.isolation, blank_theme: blankTheme } })} |
| 36 |
/> |
| 37 |
|
| 38 |
<CheckboxControl |
| 39 |
label={__('I can reproduce this consistently using the steps above', 'code-snippets')} |
| 40 |
checked={draft.isolation.reproducible} |
| 41 |
onChange={reproducible => updateDraft({ isolation: { ...draft.isolation, reproducible } })} |
| 42 |
/> |
| 43 |
</fieldset> |
| 44 |
</> |
| 45 |
|