diff --git a/src/components/Comments/index.js b/src/components/Comments/index.js deleted file mode 100644 index 5e82265..0000000 --- a/src/components/Comments/index.js +++ /dev/null @@ -1,87 +0,0 @@ -import React, { useState } from 'react'; -import { useDoc } from '@docusaurus/theme-common/internal'; -import styles from './styles.module.css'; - -const Comments = () => { - const doc = useDoc(); - const [rating, setRating] = useState(0); - const [comment, setComment] = useState(''); - const [comments, setComments] = useState([]); - - const handleSubmit = (e) => { - e.preventDefault(); - if (comment.trim()) { - setComments([ - ...comments, - { - rating, - text: comment, - date: new Date().toLocaleString(), - docId: doc.id, - }, - ]); - setComment(''); - setRating(0); - } - }; - - return ( -
-

文档评分与评论

- -
-
- {[1, 2, 3, 4, 5].map((star) => ( - setRating(star)} - > - ★ - - ))} -
-
- {rating ? `您给了 ${rating} 星评价` : '请为本文档评分'} -
-
- -
-