mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-01 09:13:57 +00:00
refactor: enhance error handling and add pagination to device queries
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 1m37s
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 1m37s
This commit is contained in:
@ -3,7 +3,7 @@ import { deviceCartAtom } from "@/lib/atoms";
|
||||
import type { Device } from "@/lib/backend-types";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { useAtom } from "jotai";
|
||||
import { Hourglass } from "lucide-react";
|
||||
import { HandCoins, Hourglass } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import AddDevicesToCartButton from "./add-devices-to-cart-button";
|
||||
import BlockDeviceDialog from "./block-device-dialog";
|
||||
@ -39,7 +39,7 @@ export default function DeviceCard({
|
||||
isChecked ? "bg-accent" : "bg-",
|
||||
device.is_active
|
||||
? "cursor-not-allowed bg-accent-foreground/10 hover:bg-accent-foreground/10"
|
||||
: "cursor-pointer hover:bg-muted",
|
||||
: "cursor-pointer hover:bg-muted-foreground/10",
|
||||
)}
|
||||
>
|
||||
<div className="">
|
||||
@ -50,7 +50,7 @@ export default function DeviceCard({
|
||||
>
|
||||
{device.name}
|
||||
</Link>
|
||||
<Badge variant={"secondary"}>
|
||||
<Badge variant={"outline"}>
|
||||
<span className="font-medium">{device.mac}</span>
|
||||
</Badge>
|
||||
</div>
|
||||
@ -74,8 +74,9 @@ export default function DeviceCard({
|
||||
)}
|
||||
{device.has_a_pending_payment && (
|
||||
<Link href={`/payments/${device.pending_payment_id}`}>
|
||||
<span className="flex hover:underline items-center justify-center gap-2 text-muted-foreground text-yellow-600">
|
||||
Payment Pending <Hourglass size={14} />
|
||||
<span className="bg-muted rounded px-2 p-1 mt-2 flex hover:underline items-center justify-center gap-2 text-muted-foreground text-yellow-600">
|
||||
Payment Pending{" "}
|
||||
<HandCoins className="animate-pulse" size={14} />
|
||||
</span>
|
||||
</Link>
|
||||
)}
|
||||
|
Reference in New Issue
Block a user