From 556c5890507233b14d6cb6a512e00821d7276f03 Mon Sep 17 00:00:00 2001 From: smallstone <> Date: Wed, 17 Jan 2024 17:13:43 +0800 Subject: [PATCH] Refactor Topic component to improve readability and maintainability --- src/views/components/InputMessage/Topic.tsx | 124 +++++++++++--------- 1 file changed, 67 insertions(+), 57 deletions(-) diff --git a/src/views/components/InputMessage/Topic.tsx b/src/views/components/InputMessage/Topic.tsx index 76668d5..1d9de20 100644 --- a/src/views/components/InputMessage/Topic.tsx +++ b/src/views/components/InputMessage/Topic.tsx @@ -105,76 +105,72 @@ export default function Topic({ styleName }) { }, }} > - {topicList.map((item: any, index) => ( - - - showTopic(item?.root_prompt)} - > - + + {topicList.map((item: any, index) => ( + + + showTopic(item?.root_prompt)} + > + + + {item?.root_prompt.title} + + + {dayjs(item?.latest_time * 1000).format("MM-DD HH:mm:ss")} + + + - {item?.root_prompt.title} + {item?.root_prompt.responses?.[0]} - + + { + deleteTopic(item?.root_prompt.hash); }} > - {dayjs(item?.latest_time * 1000).format("MM-DD HH:mm:ss")} - + + - - - {item?.root_prompt.responses?.[0]} - - - - { - deleteTopic(item?.root_prompt.hash); - }} - > - - - - {index !== topicList.length - 1 && ( - - )} - - ))} - + {index !== topicList.length - 1 && ( + + )} + + ))} + + ); }