diff --git a/apps/sim/app/workspace/[workspaceId]/settings/components/general/general.tsx b/apps/sim/app/workspace/[workspaceId]/settings/components/general/general.tsx index be33d527130..40ff85b8816 100644 --- a/apps/sim/app/workspace/[workspaceId]/settings/components/general/general.tsx +++ b/apps/sim/app/workspace/[workspaceId]/settings/components/general/general.tsx @@ -16,6 +16,7 @@ import { ModalFooter, ModalHeader, Switch, + Tooltip, } from '@/components/emcn' import { signOut, useSession } from '@/lib/auth/auth-client' import { ANONYMOUS_USER_ID } from '@/lib/auth/constants' @@ -375,7 +376,20 @@ export function General() {
- + + + + + +

Automatically connect blocks when dropped near each other

+ +
+
- + + + + + +

Show error popups on blocks when a workflow run fails

+ +
+
( ) Shortcut.displayName = 'Tooltip.Shortcut' +interface PreviewProps { + /** The URL of the image, GIF, or video to display */ + src: string + /** Alt text for the media */ + alt?: string + /** Width of the preview in pixels */ + width?: number + /** Height of the preview in pixels */ + height?: number + /** Optional additional class names */ + className?: string +} + +const VIDEO_EXTENSIONS = ['.mp4', '.webm', '.ogg', '.mov'] as const + +/** + * Displays a preview image, GIF, or video within tooltip content. + * + * @example + * ```tsx + * + *

Canvas error notifications

+ * + *
+ * ``` + */ +const Preview = ({ src, alt = '', width = 240, height, className }: PreviewProps) => { + const pathname = src.toLowerCase().split('?')[0].split('#')[0] + const isVideo = VIDEO_EXTENSIONS.some((ext) => pathname.endsWith(ext)) + + return ( +
+ {isVideo ? ( +
+ ) +} +Preview.displayName = 'Tooltip.Preview' + export const Tooltip = { Root, Trigger, Content, Provider, Shortcut, + Preview, } diff --git a/apps/sim/public/tooltips/auto-connect-on-drop.mp4 b/apps/sim/public/tooltips/auto-connect-on-drop.mp4 new file mode 100644 index 00000000000..84b07486b53 Binary files /dev/null and b/apps/sim/public/tooltips/auto-connect-on-drop.mp4 differ diff --git a/apps/sim/public/tooltips/canvas-error-notification.mp4 b/apps/sim/public/tooltips/canvas-error-notification.mp4 new file mode 100644 index 00000000000..1d7a07573e9 Binary files /dev/null and b/apps/sim/public/tooltips/canvas-error-notification.mp4 differ