From 383ffddde6274390f3f4d80b7254bdf200d6c44f Mon Sep 17 00:00:00 2001 From: i701 Date: Thu, 26 Jun 2025 19:01:25 +0500 Subject: [PATCH] =?UTF-8?q?fix:=20remove=20unused=20components=20and=20fix?= =?UTF-8?q?=20build=20=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/(dashboard)/devices/page.tsx | 5 +- components/ui/alert-dialog.tsx | 6 +- components/ui/chart.tsx | 365 ------------------------------- components/ui/dialog.tsx | 2 +- components/ui/pagination.tsx | 117 ---------- 5 files changed, 6 insertions(+), 489 deletions(-) delete mode 100644 components/ui/chart.tsx delete mode 100644 components/ui/pagination.tsx diff --git a/app/(dashboard)/devices/page.tsx b/app/(dashboard)/devices/page.tsx index b29e715..cb87c88 100644 --- a/app/(dashboard)/devices/page.tsx +++ b/app/(dashboard)/devices/page.tsx @@ -1,11 +1,10 @@ import { authOptions } from "@/app/auth"; import { DevicesTable } from "@/components/devices-table"; import DeviceFilter from "@/components/devices/device-filter"; -import Search from "@/components/search"; import AddDeviceDialogForm from "@/components/user/add-device-dialog"; import { getServerSession } from "next-auth"; import { redirect } from "next/navigation"; -import React, { Suspense } from "react"; +import { Suspense } from "react"; import DevicesTableSkeleton from "./device-table-skeleton"; export default async function Devices({ @@ -28,7 +27,7 @@ export default async function Devices({
diff --git a/components/ui/alert-dialog.tsx b/components/ui/alert-dialog.tsx index 57760f2..efbb8af 100644 --- a/components/ui/alert-dialog.tsx +++ b/components/ui/alert-dialog.tsx @@ -1,10 +1,10 @@ "use client" -import * as React from "react" import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog" +import * as React from "react" -import { cn } from "@/lib/utils" import { buttonVariants } from "@/components/ui/button" +import { cn } from "@/lib/utils" const AlertDialog = AlertDialogPrimitive.Root @@ -36,7 +36,7 @@ const AlertDialogContent = React.forwardRef< } - ) -} - -type ChartContextProps = { - config: ChartConfig -} - -const ChartContext = React.createContext(null) - -function useChart() { - const context = React.useContext(ChartContext) - - if (!context) { - throw new Error("useChart must be used within a ") - } - - return context -} - -const ChartContainer = React.forwardRef< - HTMLDivElement, - React.ComponentProps<"div"> & { - config: ChartConfig - children: React.ComponentProps< - typeof RechartsPrimitive.ResponsiveContainer - >["children"] - } ->(({ id, className, children, config, ...props }, ref) => { - const uniqueId = React.useId() - const chartId = `chart-${id || uniqueId.replace(/:/g, "")}` - - return ( - -
- - - {children} - -
-
- ) -}) -ChartContainer.displayName = "Chart" - -const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => { - const colorConfig = Object.entries(config).filter( - ([, config]) => config.theme || config.color - ) - - if (!colorConfig.length) { - return null - } - - return ( -