hezarfen_frontend
Clone
https://git.tahinli.com/Hezarfen/hezarfen_frontend.git
0 watching0 forksTypeScript5.5 MiB5fcd955Burak Boduroğlu2 months ago730 commits
| 1 | import { createSignal, type Accessor } from "solid-js"; |
| 2 | import { showToast } from "@/components/ui/toast"; |
| 3 | |
| 4 | /** Short-lived success feedback; page banners stay empty, global toast renders it. */ |
| 5 | export function createFlash(_ms = 3000): [Accessor<string>, (text: string) => void] { |
| 6 | const [message, setMessage] = createSignal(""); |
| 7 | return [message, (text) => { |
| 8 | setMessage(""); |
| 9 | showToast({ title: text }); |
| 10 | }]; |
| 11 | } |