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.

958 B
Raw Blame
import { type ComponentProps, createSignal } from 'solid-js';
import { EmailReminderForm } from '../components/email-reminder-form';
import type { EmailReminderCondition } from '../core/email-reminder';
import { createReminderTimeOptions } from '../primitives/create-reminder-time-options';

type Props = Omit<
  ComponentProps<typeof EmailReminderForm>,
  'query' | 'onQueryChange' | 'condition' | 'onConditionChange' | 'times'
> & {
  initialCondition?: EmailReminderCondition;
};

export function EmailReminderMenu(props: Props) {
  const [query, setQuery] = createSignal('');
  const [condition, setCondition] = createSignal<EmailReminderCondition>();
  const times = createReminderTimeOptions(query);
  return (
    <EmailReminderForm
      {...props}
      query={query()}
      onQueryChange={setQuery}
      condition={condition() ?? props.initialCondition ?? 'if_no_reply'}
      onConditionChange={setCondition}
      times={times()}
    />
  );
}