mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-06-07 01:26:18 +00:00
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 7m23s
30 lines
941 B
TypeScript
30 lines
941 B
TypeScript
"use client";
|
|
|
|
import { Button } from "@/components/ui/button";
|
|
import { deviceCartAtom } from "@/lib/atoms";
|
|
import { useAtomValue } from "jotai";
|
|
import { MonitorSmartphone } from "lucide-react";
|
|
import { usePathname, useRouter } from "next/navigation";
|
|
|
|
export function DeviceCartDrawer() {
|
|
const pathname = usePathname();
|
|
const devices = useAtomValue(deviceCartAtom);
|
|
const router = useRouter();
|
|
if (pathname === "/payment" || pathname === "/devices-to-pay") {
|
|
return null;
|
|
}
|
|
|
|
if (devices.length === 0) return null;
|
|
return (
|
|
<Button
|
|
size={"lg"}
|
|
className="bg-sarLinkOrange dark:hover:bg-orange-900 fixed bottom-20 w-80 uppercase h-12 z-20 left-1/2 transform -translate-x-1/2 hover:ring-2 hover:ring-sarLinkOrange transition-all duration-200"
|
|
onClick={() => router.push("/devices-to-pay")}
|
|
variant="outline"
|
|
>
|
|
<MonitorSmartphone />
|
|
Pay {devices.length > 0 && `(${devices.length})`} Device
|
|
</Button>
|
|
);
|
|
}
|