refactor: add tryCatch utility for error handling, update device-related components and types, and clean up unused code in payment actions
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 13m55s

This commit is contained in:
2025-04-05 16:07:11 +05:00
parent dbdc1df7d5
commit aa18484475
16 changed files with 641 additions and 599 deletions

View File

@ -12,7 +12,7 @@ import {
SidebarTrigger,
} from "@/components/ui/sidebar";
import { getServerSession } from "next-auth";
import { headers } from "next/headers";
import { redirect } from "next/navigation";
import { AccountPopover } from "./account-popver";
export async function ApplicationLayout({
@ -20,20 +20,22 @@ export async function ApplicationLayout({
}: { children: React.ReactNode }) {
const session = await getServerSession(authOptions);
if (!session) return redirect("/auth/signin");
return (
<SidebarProvider>
<AppSidebar role={"admin"} />
{/* <DeviceCartDrawer billFormula={billFormula || null} /> */}
<AppSidebar />
<DeviceCartDrawer />
<SidebarInset>
<header className="flex justify-between sticky top-0 bg-background h-16 shrink-0 items-center gap-2 border-b px-4 z-10">
<div className="flex items-center gap-2 ">
<SidebarTrigger className="-ml-1" />
<Separator orientation="vertical" className="mr-2 h-4" />
{session?.user.role === "ADMIN" && (
<span className="text-sm font-mono px-2 p-1 rounded-md bg-green-500/10 text-green-900 dark:text-green-400">
Welcome back {session?.user.name}
<div className="text-sm font-mono px-2 p-1 rounded-md bg-green-500/10 text-green-900 dark:text-green-400">
Welcome back,{" "}
<span className="font-semibold">
{session?.user?.first_name} {session?.user?.last_name}
</span>
)}
</div>
</div>
<div className="flex items-center gap-2">