mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-23 01:49:13 +01:00
Show import errors
This commit is contained in:
15
src-web/hooks/useAlert.ts
Normal file
15
src-web/hooks/useAlert.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import type { DialogProps } from '../components/core/Dialog';
|
||||
import { useDialog } from '../components/DialogContext';
|
||||
import type { AlertProps } from './Alert';
|
||||
import { Alert } from './Alert';
|
||||
|
||||
export function useAlert() {
|
||||
const dialog = useDialog();
|
||||
return ({ title, body }: { title: DialogProps['title']; body: AlertProps['body'] }) =>
|
||||
dialog.show({
|
||||
title,
|
||||
hideX: true,
|
||||
size: 'sm',
|
||||
render: ({ hide }) => Alert({ onHide: hide, body }),
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user