MCPcopy Create free account
hub / github.com/Noumena-Network/code / NewMessagesPill

Function NewMessagesPill

src/components/FullscreenLayout.tsx:493–539  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

491}
492function _temp() {}
493function NewMessagesPill(t0) {
494 const $ = _c(10);
495 const {
496 count,
497 onClick
498 } = t0;
499 const [hover, setHover] = useState(false);
500 let t1;
501 let t2;
502 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
503 t1 = () => setHover(true);
504 t2 = () => setHover(false);
505 $[0] = t1;
506 $[1] = t2;
507 } else {
508 t1 = $[0];
509 t2 = $[1];
510 }
511 const t3 = hover ? "userMessageBackgroundHover" : "userMessageBackground";
512 let t4;
513 if ($[2] !== count) {
514 t4 = count > 0 ? `${count} new ${plural(count, "message")}` : "Jump to bottom";
515 $[2] = count;
516 $[3] = t4;
517 } else {
518 t4 = $[3];
519 }
520 let t5;
521 if ($[4] !== t3 || $[5] !== t4) {
522 t5 = <Text backgroundColor={t3} dimColor={true}>{" "}{t4}{" "}{figures.arrowDown}{" "}</Text>;
523 $[4] = t3;
524 $[5] = t4;
525 $[6] = t5;
526 } else {
527 t5 = $[6];
528 }
529 let t6;
530 if ($[7] !== onClick || $[8] !== t5) {
531 t6 = <Box position="absolute" bottom={0} left={0} right={0} justifyContent="center"><Box onClick={onClick} onMouseEnter={t1} onMouseLeave={t2}>{t5}</Box></Box>;
532 $[7] = onClick;
533 $[8] = t5;
534 $[9] = t6;
535 } else {
536 t6 = $[9];
537 }
538 return t6;
539}
540
541// Context breadcrumb: when scrolled up into history, pin the current
542// conversation turn's prompt above the viewport so you know what NCode was

Callers

nothing calls this directly

Calls 1

pluralFunction · 0.85

Tested by

no test coverage detected