From 975c524369d4adba28c9def9e7cc59dc76665f38 Mon Sep 17 00:00:00 2001 From: IndieKKY Date: Mon, 27 May 2024 11:20:03 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E9=A2=98=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/biz/SegmentCard.tsx | 16 ++++++++++++- src/const.tsx | 50 +++++++++++++++++++++++++++++++++++++++++ src/typings.d.ts | 2 +- 3 files changed, 66 insertions(+), 2 deletions(-) diff --git a/src/biz/SegmentCard.tsx b/src/biz/SegmentCard.tsx index 289627c..f21bea6 100644 --- a/src/biz/SegmentCard.tsx +++ b/src/biz/SegmentCard.tsx @@ -5,7 +5,7 @@ import classNames from 'classnames' import {FaClipboardList} from 'react-icons/fa' import {PAGE_MAIN, PAGE_SETTINGS, SUMMARIZE_THRESHOLD, SUMMARIZE_TYPES} from '../const' import useTranslate from '../hooks/useTranslate' -import {BsDashSquare, BsPlusSquare, CgFileDocument, GrOverview, RiFileCopy2Line} from 'react-icons/all' +import {BsDashSquare, BsPlusSquare, CgFileDocument, FaQuestion, GrOverview, RiFileCopy2Line} from 'react-icons/all' import toast from 'react-hot-toast' import {getLastTime, getSummaryStr, isSummaryEmpty, parseStrTimeToSeconds} from '../util/biz_util' import {useInViewport} from 'ahooks' @@ -107,6 +107,13 @@ const Summarize = (props: {
{summary.content.summary}
} + {summary?.type === 'question' && (summary.content != null) && +
+ {summary.content.map((question: any, idx: number) =>
+

{question.q}

+
{question.a}
+
)} +
}
{segment.text.length < SUMMARIZE_THRESHOLD &&
文字过短,无法总结.
} @@ -189,6 +196,12 @@ const SegmentCard = (props: { })) }, [dispatch]) + const onSelQuestion = useCallback(() => { + dispatch(setTempData({ + curSummaryType: 'question' + })) + }, [dispatch]) + return
@@ -203,6 +216,7 @@ const SegmentCard = (props: { 总结 概览 要点 + 问题
}