feat: showing limits error on frontend

This commit is contained in:
2025-08-30 11:15:17 +01:00
parent e45688d57e
commit 8b54d502f2
4 changed files with 123 additions and 51 deletions

View File

@@ -0,0 +1,37 @@
import { Toast, toaster } from "@kobalte/core/toast";
import { IconCircleDashedX } from "@tabler/icons-solidjs";
export const createToast = (title: string, text: string) => {
console.log("creating toast")
toaster.show((props) => (
<Toast
toastId={props.toastId}
class="max-w-lg w-full bg-white shadow-lg rounded-lg pointer-events-auto flex ring-1 ring-black ring-opacity-5"
>
<div class="flex-1 w-0 p-4">
<div class="flex items-start">
<div class="flex-shrink-0 pt-0.5">
<IconCircleDashedX class="h-6 w-6 text-red-600" />
</div>
<div class="ml-3 flex-1">
<Toast.Title class="text-sm font-medium text-gray-900">
{title}
</Toast.Title>
<Toast.Description class="mt-1 text-sm text-gray-500">
{text}
</Toast.Description>
</div>
</div>
</div>
<div class="flex border-l border-gray-200">
<Toast.CloseButton class="w-full border border-transparent rounded-none rounded-r-lg p-4 flex items-center justify-center text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-indigo-500">
<span class="sr-only">Close</span>
<IconCircleDashedX class="h-5 w-5" aria-hidden="true" />
</Toast.CloseButton>
</div>
<Toast.ProgressTrack class="absolute bottom-0 left-0 right-0 h-1 bg-gray-200 rounded-b-lg overflow-hidden">
<Toast.ProgressFill class="h-full bg-indigo-600 transition-all duration-300" />
</Toast.ProgressTrack>
</Toast>
));
};