Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

995 B
Raw Blame
import { focusInput } from '@core/directive/focusInput';
import IconPlus from '@icon/system/regular/plus.svg';
import { cn } from '@ui';
import { type JSX, splitProps } from 'solid-js';

type ThreadReplyButtonProps = JSX.ButtonHTMLAttributes<HTMLButtonElement> & {
  getFocusTarget?: () => HTMLElement | null | undefined;
};

export function ThreadReplyButton(props: ThreadReplyButtonProps) {
  const [local, rest] = splitProps(props, ['class', 'getFocusTarget']);

  return (
    <button
      type="button"
      class={cn(
        'rounded-full icon-plus mb-2 border border-thread-rail hover:bg-hover flex flex-row justify-center items-center size-8 touch:min-h-(--user-icon-width) touch:min-w-(--user-icon-width) text-ink-muted hover:text-ink',
        local.class
      )}
      ref={(el) => {
        const getTarget = local.getFocusTarget;
        if (getTarget) focusInput(el, () => ({ getTarget }));
      }}
      {...rest}
    >
      <IconPlus class="size-4" />
    </button>
  );
}