'use client'; import React, { memo } from 'react'; import { CopyButton } from '@djangocfg/ui-core/components'; interface ActionRowProps { /** Raw text to copy — pass the same source string used for render. */ value: string; /** Bubble side. Just controls flex alignment; nothing is mirrored. */ isUser: boolean; /** * Whether the row is currently shown. Owner-controlled (typically * `` toggles this on hover with a small close delay). * The component is intentionally dumb about visibility — owners * have full control over reveal logic (hover, focus, always-on, * touch behaviour, etc.). */ visible: boolean; } // Action row that lives directly under a chat bubble. // Visibility is fully owner-controlled via `visible`. // // We render at `opacity-0` (not `display:none`) so the fade in/out // stays smooth across re-renders. While invisible we drop pointer // events so a hidden row can't intercept clicks meant for the page // underneath. // // Memoised: re-renders only when `value`, `isUser` or `visible` change. // All props are primitives, so default shallow comparison is sufficient. function ActionRowRaw({ value, isUser, visible }: ActionRowProps) { return (
); } export const ActionRow = memo(ActionRowRaw);