Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
import type { Dialog as DialogPrimitive } from 'radix-ui';
import type * as React from 'react';
type InteractOutsideHandler = NonNullable<
React.ComponentProps<typeof DialogPrimitive.Content>['onInteractOutside']
>;
export function ignoreToastInteractOutside(
onInteractOutside?: InteractOutsideHandler,
): InteractOutsideHandler {
return (event) => {
const target = event.target as HTMLElement | null;
if (target?.closest('[data-sonner-toaster]')) {
event.preventDefault();
return;
}
onInteractOutside?.(event);
};
}