Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
import ArrowDown from '@icon/system/regular/arrow-down.svg';
import ArrowUp from '@icon/system/regular/arrow-up.svg';
import Copy from '@icon/system/regular/copy.svg';
import DotsThree from '@icon/system/regular/dots-three.svg';
import Rows from '@icon/system/regular/rows.svg';
import Trash from '@icon/system/regular/trash.svg';
import Warning from '@icon/system/regular/warning.svg';
import { Button, Dropdown, ToggleSwitch } from '@ui';
import { For } from 'solid-js';
/**
* A selected question's actions. Removing takes it off the form and keeps the
* column; deleting the column (and its answers) is a separate, confirmed item.
*/
export function QuestionFooter(props: {
required: boolean;
canMoveUp: boolean;
canMoveDown: boolean;
sections: readonly { id: string; name: string; current: boolean }[];
onRequired: (required: boolean) => void;
onDuplicate: () => void;
onRemove: () => void;
onMoveUp: () => void;
onMoveDown: () => void;
onMoveToSection: (sectionId: string) => void;
onDeleteColumn: () => void;
}) {
return (
<div class="mt-1 flex items-center gap-1 border-t border-edge-divider pt-2">
<Button
aria-label="Duplicate question"
tooltip="Duplicate question"
variant="ghost"
size="icon-sm"
onClick={props.onDuplicate}
>
<Copy class="size-3.5 touch:size-6 shrink-0 pointer-events-none" />
</Button>
<Button
aria-label="Remove from form (keeps the column)"
tooltip="Remove from form (keeps the column)"
variant="ghost"
size="icon-sm"
onClick={props.onRemove}
>
<Trash class="size-3.5 touch:size-6 shrink-0 pointer-events-none" />
</Button>
<Dropdown>
<Dropdown.Trigger
variant="ghost"
size="icon-sm"
aria-label="More question actions"
>
<DotsThree class="size-3.5 touch:size-6 shrink-0 pointer-events-none" />
</Dropdown.Trigger>
<Dropdown.Content class="w-60">
<Dropdown.Group>
<Dropdown.Item
disabled={!props.canMoveUp}
onSelect={props.onMoveUp}
>
<ArrowUp class="size-4" />
<span class="flex-1">Move up</span>
</Dropdown.Item>
<Dropdown.Item
disabled={!props.canMoveDown}
onSelect={props.onMoveDown}
>
<ArrowDown class="size-4" />
<span class="flex-1">Move down</span>
</Dropdown.Item>
<Dropdown.Sub>
<Dropdown.SubTrigger
disabled={props.sections.filter((s) => !s.current).length === 0}
>
<Rows class="size-4" />
<span class="flex-1">Move to section</span>
</Dropdown.SubTrigger>
<Dropdown.SubContent>
<For
each={props.sections.filter((section) => !section.current)}
>
{(section) => (
<Dropdown.Item
onSelect={() => props.onMoveToSection(section.id)}
>
<span class="flex-1 truncate">{section.name}</span>
</Dropdown.Item>
)}
</For>
</Dropdown.SubContent>
</Dropdown.Sub>
</Dropdown.Group>
<Dropdown.Separator class="my-1 h-px bg-edge-divider" />
<Dropdown.Group>
<Dropdown.Item
class="text-failure-ink"
onSelect={props.onDeleteColumn}
>
<Warning class="size-4" />
<span class="flex-1">Delete column and answers…</span>
</Dropdown.Item>
</Dropdown.Group>
</Dropdown.Content>
</Dropdown>
<ToggleSwitch
label="Required"
labelClass="text-xs font-medium text-ink"
class="ml-auto min-h-8 rounded-md px-1.5"
checked={props.required}
onChange={props.onRequired}
/>
</div>
);
}