- add test button to workflow code step - add test tab to workflow code step https://github.com/user-attachments/assets/e180a827-7321-49a2-8026-88490c557da2  
31 lines
700 B
TypeScript
31 lines
700 B
TypeScript
import { Button } from 'twenty-ui';
|
|
import { useScopedHotkeys } from '@/ui/utilities/hotkey/hooks/useScopedHotkeys';
|
|
import { Key } from 'ts-key-enum';
|
|
import { RightDrawerHotkeyScope } from '@/ui/layout/right-drawer/types/RightDrawerHotkeyScope';
|
|
|
|
export const CmdEnterActionButton = ({
|
|
title,
|
|
onClick,
|
|
}: {
|
|
title: string;
|
|
onClick: () => void;
|
|
}) => {
|
|
useScopedHotkeys(
|
|
[`${Key.Control}+${Key.Enter}`, `${Key.Meta}+${Key.Enter}`],
|
|
() => onClick(),
|
|
RightDrawerHotkeyScope.RightDrawer,
|
|
[onClick],
|
|
);
|
|
|
|
return (
|
|
<Button
|
|
title={title}
|
|
variant="primary"
|
|
accent="blue"
|
|
size="medium"
|
|
onClick={onClick}
|
|
shortcut={'⌘⏎'}
|
|
/>
|
|
);
|
|
};
|