repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | import { useState } from "react"; |
| #2 | |
| #3 | export default function PurgeChats() { |
| #4 | const [status, setStatus] = useState(""); |
| #5 | const handleChatsPurge = (event) => { |
| #6 | event.preventDefault(); |
| #7 | localStorage.clear(); |
| #8 | setStatus("success"); |
| #9 | setTimeout(() => { |
| #10 | setStatus(false); |
| #11 | }, 3000); |
| #12 | }; |
| #13 | |
| #14 | return ( |
| #15 | <> |
| #16 | <div className="w-full"> |
| #17 | {/* Purge Chats */} |
| #18 | <h2 className="text-xl font-bold text-gray-800">PURGE CHATS</h2> |
| #19 | <form className="py-2" onSubmit={handleChatsPurge}> |
| #20 | <label className="block mb-2 text-sm font-medium text-red-600"> |
| #21 | Warning |
| #22 | </label> |
| #23 | <div className="flex flex-col sm:flex-row gap-x-4 gap-y-4"> |
| #24 | <div |
| #25 | type="text" |
| #26 | className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5" |
| #27 | > |
| #28 | The following action will clear all your chat logs. Proceed with |
| #29 | caution! |
| #30 | </div> |
| #31 | <button |
| #32 | type="submit" |
| #33 | className="h-fit text-white bg-red-600 hover:bg-red-600/80 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center" |
| #34 | > |
| #35 | Purge |
| #36 | </button> |
| #37 | </div> |
| #38 | {status === "success" && ( |
| #39 | <div className="text-green-600 text-sm font-bold py-1"> |
| #40 | Your chats have been purged! |
| #41 | </div> |
| #42 | )} |
| #43 | </form> |
| #44 | </div> |
| #45 | </> |
| #46 | ); |
| #47 | } |
| #48 |