Remove useNavigate everywhere, and make request a query param. And convert dialog to Jotai

This commit is contained in:
Gregory Schier
2025-01-06 16:54:07 -08:00
parent 806a8eb801
commit bc50891edb
54 changed files with 592 additions and 545 deletions

21
src-web/lib/alert.ts Normal file
View 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 }),
});
}