forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiB5fcd955Burak Boduroğlu2 months ago730 commits

error-alert.tsx24 lines, 766 bytesHistoryRawDownload
1import { Show } from "solid-js";
2import { Alert } from "@/components/ui/alert";
3import { Button } from "@/components/ui/button";
4import { useT } from "@/stores/preferences-context";
5
6export 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}