hezarfen_frontend
Clone
https://git.tahinli.com/archive/hezarfen_frontend.git
0 watching0 forksTypeScript5.5 MiBdcf123aBurak Boduroğlu2 months ago674 commits
| 1 | import { Show } from "solid-js"; |
| 2 | import { Alert } from "@/components/ui/alert"; |
| 3 | import { Button } from "@/components/ui/button"; |
| 4 | import { useT } from "@/stores/preferences-context"; |
| 5 | |
| 6 | export function ErrorAlert(props: { message: string; onRetry?: () => void }) { |
| 7 | const t = useT(); |
| 8 | return ( |
| 9 | <Alert variant="destructive" class="flex flex-wrap items-center justify-between gap-3"> |
| 10 | <span class="min-w-0 flex-1">{props.message}</span> |
| 11 | <Show when={!!props.onRetry}> |
| 12 | <Button |
| 13 | type="button" |
| 14 | size="sm" |
| 15 | variant="outline" |
| 16 | class="shrink-0 rounded-lg border-destructive/40" |
| 17 | onClick={() => props.onRetry?.()} |
| 18 | > |
| 19 | {t("common.tryAgain")} |
| 20 | </Button> |
| 21 | </Show> |
| 22 | </Alert> |
| 23 | ); |
| 24 | } |