1 import { v4 as uuid } from 'uuid';
3 export function Alert(type: 'error' | 'success', text: string): string {
4 return `<div hx-swap-oob="afterbegin:#alerts">
5 <div class="alert ${type}" id="alert-${uuid()}">${text}</div>
10 export function SuccessAlert(text: string): string {
11 return Alert('success', text);
14 export function ErrorAlert(text: string): string {
15 return Alert('error', text);