import React from 'react' import { SelectControl, TextareaControl } from '@wordpress/components' import { __ } from '@wordpress/i18n' import { BugDetailFields } from './BugDetailFields' import { ReportSummaryFields } from './ReportSummaryFields' import { ReporterFields } from './ReporterFields' import type { FeedbackReport } from '../../hooks/useFeedbackReport' import type { FeedbackConfig, FeedbackDraft } from '../../types/Feedback' const TYPE_OPTIONS = [ { label: __('Choose one…', 'code-snippets'), value: '' }, { label: __('Bug — something is broken', 'code-snippets'), value: 'bug' }, { label: __('Feature request — something is missing', 'code-snippets'), value: 'feature' }, { label: __('General feedback', 'code-snippets'), value: 'feedback' } ] export interface FeedbackFormProps { config: FeedbackConfig report: FeedbackReport } export const FeedbackForm: React.FC = ({ config, report }) => { const { draft, duplicates, errorMessage, updateDraft } = report const type = draft.type return <> {errorMessage &&

{errorMessage}

}
updateDraft({ type: value as FeedbackDraft['type'] })} />
{type && <> {'bug' === type && }
updateDraft({ comments })} />
} }