()
| 4 | import ClearConversationConfirmModal from "./ClearConversationConfirmModal"; |
| 5 | |
| 6 | const 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 | |
| 27 | export default ClearConversationButton; |
nothing calls this directly
no outgoing calls
no test coverage detected