mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-18 14:59:42 +02:00
Remove useNavigate everywhere, and make request a query param. And convert dialog to Jotai
This commit is contained in:
21
src-web/lib/alert.ts
Normal file
21
src-web/lib/alert.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import type { DialogProps } from '../components/core/Dialog';
|
||||
import type { AlertProps } from '../hooks/Alert';
|
||||
import { Alert } from '../hooks/Alert';
|
||||
import { showDialog } from './dialog';
|
||||
|
||||
interface AlertArgs {
|
||||
id: string;
|
||||
title: DialogProps['title'];
|
||||
body: AlertProps['body'];
|
||||
size?: DialogProps['size'];
|
||||
}
|
||||
|
||||
export function showAlert({ id, title, body, size = 'sm' }: AlertArgs) {
|
||||
showDialog({
|
||||
id,
|
||||
title,
|
||||
hideX: true,
|
||||
size,
|
||||
render: ({ hide }) => Alert({ onHide: hide, body }),
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user