export const DHRAVYA = { name: "Dhravya Shah", avatar: "/docs/images/company-brain/dhravya-slack-icon.jpg", }; export const BOT_AVATAR = "/docs/images/company-brain/supermemory-slack-icon.png"; export const Mention = ({ children, self = false }) => ( @{children} ); export const ChannelRef = ({ children }) => ( #{children} ); export const SlackButton = ({ children, variant = "default" }) => ( {children} ); export const SlackUnfurl = ({ color = "#8a94a6", footer, children }) => (
{children}
{footer ? (
{footer}
) : null}
); export const SlackThread = ({ type = "channel", channel = "general", private: isPrivate = false, members, dmWith, maxHeight = "70vh", children, }) => { const composerLabel = type === "dm" ? `Message ${dmWith?.name || "someone"}` : type === "thread" ? "Reply..." : `Message ${isPrivate ? "" : "#"}${channel.replace(/^#/, "")}`; return (
{type === "thread" ? (
Thread
) : type === "dm" ? (
{dmWith?.name
{dmWith?.name || "Direct message"}
) : (
{isPrivate ? ( ) : ( )} {channel.replace(/^#/, "")}
{members ? (
{members}
) : null}
)}
{ if (!el || !maxHeight) return; const wrapper = el.parentElement; const aboveHint = wrapper?.querySelector('[data-hint="above"]'); const belowHint = wrapper?.querySelector('[data-hint="below"]'); const update = () => { const hasAbove = el.scrollTop > 4; const hasBelow = el.scrollHeight - el.scrollTop - el.clientHeight > 4; if (aboveHint) aboveHint.style.opacity = hasAbove ? "1" : "0"; if (belowHint) belowHint.style.opacity = hasBelow ? "1" : "0"; }; update(); el.addEventListener("scroll", update); requestAnimationFrame(update); }} className="overflow-y-auto bg-white dark:bg-[#1A1D21]" style={maxHeight ? { maxHeight } : undefined} > {children}
{maxHeight ? (
↑ More messages above
) : null} {maxHeight ? (
More messages below ↓
) : null}
{composerLabel}
); }; export const SlackReplyDivider = ({ count = 1 }) => (
{count} {count === 1 ? "reply" : "replies"}
); export const SlackMessage = ({ name, self = false, bot = false, time, color = "#611f69", avatar, badges, reactions, highlighted = false, subtitle, children, }) => { const SELF_NAME = "Dhravya Shah"; const SELF_AVATAR = "/docs/images/company-brain/dhravya-slack-icon.jpg"; const BOT_AVATAR = "/docs/images/company-brain/supermemory-slack-icon.png"; const resolvedName = bot ? "supermemory" : self ? SELF_NAME : name || SELF_NAME; const resolvedAvatar = bot ? BOT_AVATAR : self ? SELF_AVATAR : avatar; const resolvedBadges = badges || (bot ? ["AGENT"] : null); return (
{["✅", "👀", "🙌", "😊", "â†Šī¸", "⋯"].map((icon, i) => ( {icon} ))}
{resolvedAvatar ? ( {resolvedName} ) : (
{(resolvedName || "?").slice(0, 1).toUpperCase()}
)}
{resolvedName} {subtitle ? ( ({subtitle}) ) : null} {resolvedBadges ? resolvedBadges.map((b) => ( {b} )) : null} {time ? ( {time} ) : null}
{children}
{reactions ? (
{reactions.map((r, i) => ( {r.emoji} {r.count} ))}
) : null}
); }; export const FileAttachment = ({ name, size }) => (
{name}
{size ? (
{size}
) : null}
); export const AgentLink = ({ href, children }) => ( {children} );