From 7de12016750bb93e72424c99167bb95d09869277 Mon Sep 17 00:00:00 2001 From: vergiLgood1 Date: Fri, 21 Feb 2025 18:50:04 +0700 Subject: [PATCH] add action search bar --- sigap-website/app/globals.css | 11 + .../app/protected/(admin-pages)/layout.tsx | 35 ++- .../components/action-search-bar.tsx | 234 ++++++++++++++++++ sigap-website/components/inbox-drawer.tsx | 19 +- sigap-website/components/ui/input.tsx | 2 +- sigap-website/hooks/use-debounce.ts | 20 ++ sigap-website/package-lock.json | 70 ++++++ sigap-website/package.json | 2 + 8 files changed, 371 insertions(+), 22 deletions(-) create mode 100644 sigap-website/components/action-search-bar.tsx create mode 100644 sigap-website/hooks/use-debounce.ts diff --git a/sigap-website/app/globals.css b/sigap-website/app/globals.css index d379bcb..373267a 100644 --- a/sigap-website/app/globals.css +++ b/sigap-website/app/globals.css @@ -83,3 +83,14 @@ @apply bg-background text-foreground; } } + + + +@layer base { + * { + @apply border-border outline-ring/50; + } + body { + @apply bg-background text-foreground; + } +} diff --git a/sigap-website/app/protected/(admin-pages)/layout.tsx b/sigap-website/app/protected/(admin-pages)/layout.tsx index f533417..3c2785f 100644 --- a/sigap-website/app/protected/(admin-pages)/layout.tsx +++ b/sigap-website/app/protected/(admin-pages)/layout.tsx @@ -1,3 +1,4 @@ +import type React from "react"; import { AppSidebar } from "@/components/app-sidebar"; import { Breadcrumb, @@ -8,7 +9,6 @@ import { BreadcrumbSeparator, } from "@/components/ui/breadcrumb"; import { Button } from "@/components/ui/button"; -import { Separator } from "@/components/ui/separator"; import { SidebarInset, SidebarProvider, @@ -20,9 +20,11 @@ import { DropdownMenuItem, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; -import { MoreHorizontal, MoreVertical } from "lucide-react"; +import { MoreHorizontal } from "lucide-react"; import { InboxDrawer } from "@/components/inbox-drawer"; import { ThemeSwitcher } from "@/components/theme-switcher"; +import ActionSearchBar from "@/components/action-search-bar"; +import { Separator } from "@/components/ui/separator"; export default async function Layout({ children, @@ -33,24 +35,33 @@ export default async function Layout({ -
-
- + {/* Navigation bar with SidebarTrigger and Breadcrumbs */} + + + {/* Header with action bar and other controls */} +
+
+ +
+
- + @@ -71,4 +82,4 @@ export default async function Layout({ ); -} \ No newline at end of file +} diff --git a/sigap-website/components/action-search-bar.tsx b/sigap-website/components/action-search-bar.tsx new file mode 100644 index 0000000..575e9b9 --- /dev/null +++ b/sigap-website/components/action-search-bar.tsx @@ -0,0 +1,234 @@ +"use client" + +import type React from "react" + +import { useState, useEffect } from "react" +import { Input } from "@/components/ui/input" +import { motion, AnimatePresence } from "framer-motion" +import { Search, Send, BarChart2, Globe, Video, PlaneTakeoff, AudioLines } from "lucide-react" +import useDebounce from "@/hooks/use-debounce" + +interface Action { + id: string + label: string + icon: React.ReactNode + description?: string + short?: string + end?: string +} + +interface SearchResult { + actions: Action[] +} + +const allActions = [ + { + id: "1", + label: "Book tickets", + icon: , + description: "Operator", + short: "⌘K", + end: "Agent", + }, + { + id: "2", + label: "Summarize", + icon: , + description: "gpt-4o", + short: "⌘cmd+p", + end: "Command", + }, + { + id: "3", + label: "Screen Studio", + icon: