import { Alert, Button, Divider, Form, Select } from 'antd'; import { useIntl, useLocale } from 'dumi'; import React, { useEffect } from 'react'; import { styled } from 'styled-components'; import { useSnapshot } from 'valtio'; import { feedbackStore, resetPageFeedback } from '../../model/feedback'; import { useGithubRepo } from '../../utils/github'; import { useFeedbackService, type FeedbackApiParams } from './service'; const StyledFeedbackMessageWrapper = styled.div<{ $rating?: string }>` display: ${(props) => (props.$rating ? 'block' : 'none')}; .ant-divider-horizontal { margin: 16px 0; } .alert { margin: 12px 0 16px; padding: 16px; font-size: 13px; line-height: 1.8; background-color: rgba(255, 251, 235, 0.5); border: 1px solid rgba(173, 104, 0, 0.15); border-radius: 8px; .ant-alert-icon { color: #cc8800; } } .alert-link { color: #56390c; font-weight: bold; text-decoration: underline; } .ant-form-item:last-child { margin-bottom: 8px; } `; export const PageFeedbackReasonForm: React.FC = () => { const { formatMessage } = useIntl(); const [form] = Form.useForm(); const feedbackState = useSnapshot(feedbackStore); const { owner, repo } = useGithubRepo(); const pageUrl = window.location.href; const locale = useLocale(); const currentLocale = locale.id; const issueUrl = `https://github.com/${owner}/${repo}/issues/new?labels=status%3A+waiting+for+maintainer%2Cdocs-feedback&template=docs-feedback.yml&title=[docs]+&page-url=${pageUrl}`; const alertMsg = (