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 { Badge } from "@/components/ui/badge"; |
| #2 | import { Card } from "@/components/ui/card"; |
| #3 | import { ScrollArea } from "@radix-ui/react-scroll-area"; |
| #4 | import { Memory } from "../types"; |
| #5 | import GlobalContext from "@/contexts/GlobalContext"; |
| #6 | import { useContext } from "react"; |
| #7 | import { motion } from "framer-motion"; |
| #8 | |
| #9 | |
| #10 | // eslint-disable-next-line @typescript-eslint/no-unused-vars |
| #11 | const MemoryItem = ({ memory }: { memory: Memory; index: number }) => { |
| #12 | return ( |
| #13 | <motion.div |
| #14 | layout |
| #15 | initial={{ opacity: 0, y: 20 }} |
| #16 | animate={{ opacity: 1, y: 0 }} |
| #17 | exit={{ opacity: 0, y: -20 }} |
| #18 | transition={{ duration: 0.3 }} |
| #19 | key={memory.id} |
| #20 | className="space-y-2" |
| #21 | > |
| #22 | <div className="flex items-start justify-between"> |
| #23 | <p className="text-sm font-medium">{memory.content}</p> |
| #24 | </div> |
| #25 | <div className="flex items-center space-x-2 text-xs text-muted-foreground"> |
| #26 | <span>{new Date(memory.timestamp).toLocaleString()}</span> |
| #27 | </div> |
| #28 | <div className="flex flex-wrap gap-1"> |
| #29 | {memory.tags.map((tag) => ( |
| #30 | <Badge key={tag} variant="secondary" className="text-xs"> |
| #31 | {tag} |
| #32 | </Badge> |
| #33 | ))} |
| #34 | </div> |
| #35 | </motion.div> |
| #36 | ); |
| #37 | }; |
| #38 | |
| #39 | const Memories = (props: { isMemoriesExpanded: boolean }) => { |
| #40 | const { isMemoriesExpanded } = props; |
| #41 | const { memories } = useContext(GlobalContext); |
| #42 | |
| #43 | return ( |
| #44 | <Card |
| #45 | className={`border-l rounded-none flex flex-col transition-all duration-300 ${ |
| #46 | isMemoriesExpanded ? "w-80" : "w-0 overflow-hidden" |
| #47 | }`} |
| #48 | > |
| #49 | <div className="px-4 py-[22px] border-b"> |
| #50 | <span className="font-semibold"> |
| #51 | Relevant Memories ({memories.length}) |
| #52 | </span> |
| #53 | </div> |
| #54 | {memories.length === 0 && ( |
| #55 | <motion.div |
| #56 | initial={{ opacity: 0 }} |
| #57 | animate={{ opacity: 1 }} |
| #58 | className="p-4 text-center" |
| #59 | > |
| #60 | <span className="font-semibold">No relevant memories found.</span> |
| #61 | <br /> |
| #62 | Only the relevant memories will be displayed here. |
| #63 | </motion.div> |
| #64 | )} |
| #65 | <ScrollArea className="flex-1 p-4"> |
| #66 | <motion.div |
| #67 | className="space-y-4" |
| #68 | > |
| #69 | {/* <AnimatePresence mode="popLayout"> */} |
| #70 | {memories.map((memory: Memory, index: number) => ( |
| #71 | <MemoryItem |
| #72 | key={memory.id} |
| #73 | memory={memory} |
| #74 | index={index} |
| #75 | /> |
| #76 | ))} |
| #77 | {/* </AnimatePresence> */} |
| #78 | </motion.div> |
| #79 | </ScrollArea> |
| #80 | </Card> |
| #81 | ); |
| #82 | }; |
| #83 | |
| #84 | export default Memories; |