MCPcopy Create free account
hub / github.com/sqlchat/sqlchat / ClearConversationButton

Function ClearConversationButton

src/components/ClearConversationButton.tsx:6–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4import ClearConversationConfirmModal from "./ClearConversationConfirmModal";
5
6const ClearConversationButton = () => {
7 const conversationStore = useConversationStore();
8 const messageStore = useMessageStore();
9 const [showConfirmModal, setShowConfirmModal] = useState(false);
10 const messageList = messageStore.messageList.filter((message) => message.conversationId === conversationStore.currentConversationId);
11
12 return (
13 <>
14 <button
15 className="mr-2 opacity-80 hover:opacity-100 disabled:cursor-not-allowed disabled:opacity-60"
16 disabled={messageList.length === 0}
17 onClick={() => setShowConfirmModal(true)}
18 >
19 <Icon.GiBroom className="w-6 h-auto" />
20 </button>
21
22 {showConfirmModal && <ClearConversationConfirmModal close={() => setShowConfirmModal(false)} />}
23 </>
24 );
25};
26
27export default ClearConversationButton;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected