Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 17 additions & 24 deletions components/dashboard-components/SearchDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
"use client";
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from "lucide-react"

import {
Expand All @@ -21,10 +16,6 @@ import {
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog"
import { Button } from "../ui/button"
Expand Down Expand Up @@ -65,21 +56,23 @@ export default function SearchDialog({Variant,WithTheTitle,IconSize}:SearchDialo
<CommandEmpty className="text-brand_tertiary p-2">{(getNotes&&getNotes?.length!==0)?"No results found.":"it looks like you don't have any note's."}</CommandEmpty>
{
(getNotes&&getNotes?.length!==0)?
getNotes.map((note) => (
<CommandGroup key={note._id} heading="Suggestions">
<CommandItem className=" group hover:bg-brand_tertiary/5 aria-selected:bg-brand_tertiary/5">
<button onClick={() => note.slug && handleRouting(note._id, note.slug,note.workingSpacesSlug)} className="w-full h-full flex flex-shrink-0 flex-grow-0 justify-between items-start gap-1">
<h1 className="text-lg font-medium text-nowrap">
{note.title ? (note.title.length > 20 ? `${note.title.substring(0, 20)}...` : note.title) : 'Untitled'}
</h1>
<span className="flex justify-center items-center gap-1 transition-all duration-200 ease-in-out opacity-10 group-hover:opacity-80">
<Calendar size="16"/>
<p className=" font-normal text-sm">{new Date(note.createdAt).toLocaleDateString()}</p>
</span>
</button>
</CommandItem>
</CommandGroup>
)):<p className="text-brand_tertiary">{`it looks like you don't have any note's`}</p>
<CommandGroup heading="Suggestions">
{
getNotes.map((note) => (
<CommandItem key={note._id} className=" group hover:bg-brand_tertiary/5 aria-selected:bg-brand_tertiary/5">
<button onClick={() => note.slug && handleRouting(note._id, note.slug,note.workingSpacesSlug)} className="w-full h-full flex flex-shrink-0 flex-grow-0 justify-between items-start gap-1">
<h1 className="text-lg font-medium text-nowrap">
{note.title ? (note.title.length > 20 ? `${note.title.substring(0, 20)}...` : note.title) : 'Untitled'}
</h1>
<span className="flex justify-center items-center gap-1 transition-all duration-200 ease-in-out opacity-10 group-hover:opacity-80">
<Calendar size="16"/>
<p className=" font-normal text-sm">{new Date(note.createdAt).toLocaleDateString()}</p>
</span>
</button>
</CommandItem>
))
}
</CommandGroup>:<p className="text-brand_tertiary">{`it looks like you don't have any note's`}</p>
}
</CommandList>
</Command>
Expand Down