diff --git a/dashboard/src/components/dashboard/ProductGrid.jsx b/dashboard/src/components/dashboard/ProductGrid.jsx
index b746bab..39f2946 100644
--- a/dashboard/src/components/dashboard/ProductGrid.jsx
+++ b/dashboard/src/components/dashboard/ProductGrid.jsx
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from "react";
import axios from "axios";
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card";
import { ScrollArea } from "@/components/ui/scroll-area";
-import { Loader2, ArrowUpDown, AlertCircle, Package, Settings2, Search } from "lucide-react";
+import { Loader2, ArrowUpDown, AlertCircle, Package, Settings2, Search, X } from "lucide-react";
import {
Table,
TableBody,
@@ -46,6 +46,7 @@ const ProductGrid = ({
direction: "desc",
});
const [searchQuery, setSearchQuery] = useState("");
+ const [isSearchVisible, setIsSearchVisible] = useState(false);
useEffect(() => {
fetchProducts();
@@ -163,41 +164,67 @@ const ProductGrid = ({
return (
-
-
- {title}
- {description && (
- {description}
- )}
-
-
- {!error && (
-
-
- setSearchQuery(e.target.value)}
- className="pl-8 h-9 w-[200px]"
- />
-
- )}
-
+
+
+
+ {title}
+ {description && (
+ {description}
+ )}
+
+
+ {!error && (
+
+ )}
+
+
+ {isSearchVisible && !error && (
+
+
+ setSearchQuery(e.target.value)}
+ className="pl-9 pr-9 h-9 w-full"
+ autoFocus
+ />
+ {searchQuery && (
+
+ )}
+
+ )}
@@ -225,39 +252,39 @@ const ProductGrid = ({
- |
-
+ | |
+
|
-
+ |
|
-
+ |
|
-
+ |
|