mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-02 15:33:12 +00:00
39 lines
893 B
TypeScript
39 lines
893 B
TypeScript
import { Button } from "@/components/ui/button";
|
|
import { Text } from "@/components/ui/text";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
type QueryErrorPanelProps = {
|
|
message?: string;
|
|
onRetry?: () => void;
|
|
className?: string;
|
|
compact?: boolean;
|
|
};
|
|
|
|
export function QueryErrorPanel({
|
|
message = "Something went wrong. Please try again.",
|
|
onRetry,
|
|
className,
|
|
compact = false,
|
|
}: QueryErrorPanelProps) {
|
|
return (
|
|
<div
|
|
className={cn(
|
|
"flex flex-col items-start gap-2 rounded-lg border border-border bg-background",
|
|
compact ? "p-3" : "p-4",
|
|
className,
|
|
)}
|
|
>
|
|
<Text variant="error">{message}</Text>
|
|
{Boolean(onRetry) && (
|
|
<Button
|
|
variant="outline"
|
|
size="default"
|
|
onClick={onRetry}
|
|
sx={{ minHeight: 32, height: 32 }}
|
|
>
|
|
Retry
|
|
</Button>
|
|
)}
|
|
</div>
|
|
);
|
|
}
|