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.

1.2 KB
Raw Blame
import TrashIcon from '@icon/system/regular/trash.svg';
import { Button } from '@ui';
import { Show } from 'solid-js';

type BotDetailActionsProps = {
  canDelete: boolean;
  dirty: boolean;
  pending: boolean;
  saving: boolean;
  onBack: () => void;
  onDelete: () => void;
};

export function BotDetailActions(props: BotDetailActionsProps) {
  return (
    <div class="flex items-center justify-between gap-3 pt-1">
      <Show when={props.canDelete}>
        <Button
          type="button"
          variant="danger"
          size="sm"
          disabled={props.pending}
          onClick={props.onDelete}
        >
          <TrashIcon class="size-3 touch:size-6 shrink-0 pointer-events-none" />
          Delete bot
        </Button>
      </Show>
      <div class="ml-auto flex items-center gap-2">
        <Button
          type="button"
          variant="ghost"
          size="sm"
          disabled={props.pending}
          onClick={props.onBack}
        >
          Back
        </Button>
        <Button
          type="submit"
          variant="primary"
          size="sm"
          disabled={!props.dirty || props.pending}
        >
          {props.saving ? 'Saving…' : 'Save changes'}
        </Button>
      </div>
    </div>
  );
}