refactor: reorganize imports and improve session handling in various components 🔨
Some checks are pending
Build and Push Docker Images / Build and Push Docker Images (push) Has started running

This commit is contained in:
2025-07-01 07:53:21 +05:00
parent 1549b209b3
commit a6d844e8d1
11 changed files with 121 additions and 143 deletions

View File

@ -1,15 +1,14 @@
"use client";
import { Loader2, Plus } from "lucide-react";
import { useActionState, useEffect, useState } from "react"; // Import useActionState
import { toast } from "sonner";
import { Button } from "@/components/ui/button";
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Loader2, Plus } from "lucide-react";
import { useActionState, useEffect, useState } from "react"; // Import useActionState
import { toast } from "sonner";
import { GetMacAccordion } from "../how-to-get-mac";
import { addDeviceAction } from "@/queries/devices";
import { GetMacAccordion } from "../how-to-get-mac";
export type AddDeviceFormState = {
message: string;
@ -72,7 +71,7 @@ export default function AddDeviceDialogForm({ user_id }: { user_id?: string }) {
<div className="grid gap-4 py-4">
<div className="flex flex-col gap-2">
<div>
<Label htmlFor="device_name" className="text-right">
<Label htmlFor="device_name">
Device Name
</Label>
<Input
@ -91,7 +90,7 @@ export default function AddDeviceDialogForm({ user_id }: { user_id?: string }) {
</div>
<div>
<Label htmlFor="mac_address" className="text-right">
<Label htmlFor="mac_address">
Mac Address
</Label>
<Input