From eb4d598d0f11d2b15eb651ff72984759c4328cc3 Mon Sep 17 00:00:00 2001 From: sabaimran Date: Thu, 10 Oct 2024 20:40:59 -0700 Subject: [PATCH] Eliminate the drawer component from the Agents view --- src/interface/web/app/agents/page.tsx | 449 ++++++++------------------ 1 file changed, 134 insertions(+), 315 deletions(-) diff --git a/src/interface/web/app/agents/page.tsx b/src/interface/web/app/agents/page.tsx index 59d9d545..800dcb16 100644 --- a/src/interface/web/app/agents/page.tsx +++ b/src/interface/web/app/agents/page.tsx @@ -32,7 +32,6 @@ import { Globe, LockOpen, FloppyDisk, - DotsThreeCircleVertical, DotsThreeVertical, Pencil, Trash, @@ -46,16 +45,6 @@ import { DialogHeader, DialogTrigger, } from "@/components/ui/dialog"; -import { - Drawer, - DrawerClose, - DrawerContent, - DrawerDescription, - DrawerFooter, - DrawerHeader, - DrawerTitle, - DrawerTrigger, -} from "@/components/ui/drawer"; import LoginPrompt from "../components/loginPrompt/loginPrompt"; import { InlineLoading } from "../components/loading/loading"; import SidePanel from "../components/sidePanel/chatHistorySidePanel"; @@ -340,281 +329,149 @@ function AgentCard(props: AgentCardProps) { )} - {!props.isMobileWidth ? ( - { - setShowModal(!showModal); - window.history.pushState({}, `Khoj AI - Agents`, `/agents`); - }} - > - -
- {getIconFromIconName(props.data.icon, props.data.color)} - {props.data.name} -
-
-
- {props.editCard && ( -
- - - - - { + setShowModal(!showModal); + window.history.pushState({}, `Khoj AI - Agents`, `/agents`); + }} + > + +
+ {getIconFromIconName(props.data.icon, props.data.color)} + {props.data.name} +
+
+
+ {props.editCard && ( +
+ + + + + + + {props.editCard && + props.data.privacy_level !== "private" && ( + + )} + {props.data.creator === userData?.username && ( - {props.editCard && - props.data.privacy_level !== "private" && ( - - )} - {props.data.creator === userData?.username && ( - - )} - - -
- )} -
- {props.userProfile ? ( - - ) : ( - - )} + )} + +
-
- {props.editCard ? ( - - - Edit {props.data.name} - - - - ) : ( - - -
- {getIconFromIconName(props.data.icon, props.data.color)} -

{props.data.name}

-
-
-
- {props.data.persona} -
-
- {makeBadgeFooter()} -
- - - -
)} -
- ) : ( - { - setShowModal(open); - window.history.pushState({}, `Khoj AI - Agents`, `/agents`); - }} - > - -
- {getIconFromIconName(props.data.icon, props.data.color)} - {props.data.name} -
-
-
- {props.editCard && ( -
- - - - - - - {props.editCard && - props.data.privacy_level !== "private" && ( - - )} - {props.data.creator === userData?.username && ( - - )} - - -
+
+ {props.userProfile ? ( + + ) : ( + )} -
- {props.userProfile ? ( - - ) : ( - - )} -
- {props.editCard ? ( - - - - ) : ( - - - {props.data.name} - Persona - +
+ {props.editCard ? ( + + + Edit {props.data.name} + + + + ) : ( + + +
+ {getIconFromIconName(props.data.icon, props.data.color)} +

{props.data.name}

+
+
+
{props.data.persona} -
- {makeBadgeFooter()} -
- - Done - - - )} - - )} +
+
+ {makeBadgeFooter()} +
+ + + +
+ )} +
@@ -930,7 +787,7 @@ function AgentModificationForm(props: AgentModificationFormProps) { />
Look & Feel -
+
- -
- - Create Agent -
-
- - - Create Agent - - {!props.userProfile && showLoginPrompt && ( - - )} - - - Dismiss - - - - ); - } - return (