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

Function StickyPromptHeader

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

Source from the content-addressed store, hash-verified

551// ScrollBox, and the diff engine sees "everything moved"). Fixed height
552// keeps the ScrollBox anchored; only the header TEXT changes, not its box.
553function StickyPromptHeader(t0) {
554 const $ = _c(8);
555 const {
556 text,
557 onClick
558 } = t0;
559 const [hover, setHover] = useState(false);
560 const t1 = hover ? "userMessageBackgroundHover" : "userMessageBackground";
561 let t2;
562 let t3;
563 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
564 t2 = () => setHover(true);
565 t3 = () => setHover(false);
566 $[0] = t2;
567 $[1] = t3;
568 } else {
569 t2 = $[0];
570 t3 = $[1];
571 }
572 let t4;
573 if ($[2] !== text) {
574 t4 = <Text color="subtle" wrap="truncate-end">{figures.pointer} {text}</Text>;
575 $[2] = text;
576 $[3] = t4;
577 } else {
578 t4 = $[3];
579 }
580 let t5;
581 if ($[4] !== onClick || $[5] !== t1 || $[6] !== t4) {
582 t5 = <Box flexShrink={0} width="100%" height={1} paddingRight={1} backgroundColor={t1} onClick={onClick} onMouseEnter={t2} onMouseLeave={t3}>{t4}</Box>;
583 $[4] = onClick;
584 $[5] = t1;
585 $[6] = t4;
586 $[7] = t5;
587 } else {
588 t5 = $[7];
589 }
590 return t5;
591}
592
593// Slash-command suggestion overlay — see promptOverlayContext.tsx for why
594// it's portaled. Scroll-smear from floating over the DECSTBM region is

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected