From 13d0a10d7f7e2c85a2e41d91c9ee6b99146f9edd Mon Sep 17 00:00:00 2001 From: Yash Date: Tue, 2 Apr 2024 11:43:42 +0000 Subject: placeholder --- apps/web/src/components/Sidebar/index.tsx | 59 ++++++++++++++++--------------- apps/web/src/components/ui/input.tsx | 16 +++++---- 2 files changed, 41 insertions(+), 34 deletions(-) (limited to 'apps/web/src') diff --git a/apps/web/src/components/Sidebar/index.tsx b/apps/web/src/components/Sidebar/index.tsx index 569fc353..a140a19c 100644 --- a/apps/web/src/components/Sidebar/index.tsx +++ b/apps/web/src/components/Sidebar/index.tsx @@ -1,18 +1,21 @@ "use client"; import { StoredContent } from "@/server/db/schema"; import { MemoryIcon } from "../../assets/Memories"; -import { Trash2, User2 } from "lucide-react"; +import { Search, Trash2, User2 } from "lucide-react"; import React, { useState } from "react"; +import { InputWithIcon } from "../ui/input"; export type MenuItem = { icon: React.ReactNode | React.ReactNode[]; label: string; + content?: React.FC; }; const menuItemsTop: Array = [ { icon: , label: "Memories", + content: MemoriesBar, }, ]; @@ -32,15 +35,19 @@ export default function Sidebar({ }: { onSelectChange?: (selectedItem: string | null) => void; }) { + const menuItems = [...menuItemsTop, ...menuItemsBottom]; const [selectedItem, setSelectedItem] = useState(null); React.useEffect(() => { onSelectChange?.(selectedItem); }, [selectedItem]); + const Subbar = + menuItems.find((i) => i.label === selectedItem)?.content ?? (() => <>); + return ( <> - - {selectedItem && } + + {selectedItem && ( + + + + )} ); } @@ -83,31 +94,23 @@ const MenuItem = ({ ); -export function SubSidebar() { - const pages: StoredContent[] = [ - { - id: 1, - content: "", - title: "Visual Studio Code", - url: "https://code.visualstudio.com", - description: "", - image: "https://code.visualstudio.com/favicon.ico", - baseUrl: "https://code.visualstudio.com", - savedAt: new Date(), - }, - { - id: 2, - content: "", - title: "yxshv/vscode: An unofficial remake of vscode's landing page", - url: "https://github.com/yxshv/vscode", - description: "", - image: "https://github.com/favicon.ico", - baseUrl: "https://github.com", - savedAt: new Date(), - }, - ]; +export function SubSidebar({ children }: { children?: React.ReactNode }) { + return ( +
+ {children} +
+ ); +} +export function MemoriesBar() { return ( - +
+

Your Memories

+ } + className="mt-2" + /> +
); } diff --git a/apps/web/src/components/ui/input.tsx b/apps/web/src/components/ui/input.tsx index dba310dc..deb877dd 100644 --- a/apps/web/src/components/ui/input.tsx +++ b/apps/web/src/components/ui/input.tsx @@ -11,7 +11,7 @@ const Input = React.forwardRef( ( ({ className, type, icon, ...props }, ref) => { return ( -
+
{icon} -- cgit v1.2.3