Skip to content
Merged
Show file tree
Hide file tree
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
20 changes: 15 additions & 5 deletions src/components/pages/(protected)/common/navbar/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export function UserDetails() {
navigator.clipboard.writeText(sessionData?.orgId)
toast.info("Organization ID copied to clipboard")
}

return (
<div className="flex items-center gap-2">
{sessionData ? (
Expand Down Expand Up @@ -55,24 +56,33 @@ export function UserDetails() {

export function Account(props: ButtonProps) {
const router = useRouter()
const { closeSession } = useSessionContext()
const { closeSession, sessionData } = useSessionContext()

function handleLogout() {
closeSession()
router.replace("/user/login")
}

return (
<Popover>
<PopoverTrigger asChild>
<PopoverTrigger
asChild
className="bg-transparent hover:bg-transparent"
>
<Button
variant="ghost"
size="icon"
className={cn("h-8 w-8 rounded-full", props.className)}
className={cn(
"h-8 w-8 rounded-full hover:bg-transparent",
props.className,
)}
{...props}
>
<Avatar className="h-8 w-8">
<AvatarImage src="https://github.com/vaxad.png" />
<AvatarFallback>U</AvatarFallback>
<AvatarFallback>
{sessionData?.sessionUser.userFirstName[0].toUpperCase() ||
"U"}
</AvatarFallback>
</Avatar>
<span className="sr-only">Profile</span>
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default function QueryForm({ workflowData }: WorkflowIdComponentProps) {
return streamedMessage
}

return messages[idx].content || "### Thinking..."
return messages[idx].content || "Thinking..."
},
[messages, streamedMessage],
)
Expand All @@ -71,7 +71,7 @@ export default function QueryForm({ workflowData }: WorkflowIdComponentProps) {
<div key={index} className="mb-4 text-background">
<div
className={cn(
"max-w-4/5 w-4/5 overflow-x-auto rounded-lg bg-foreground p-3",
"w-fit max-w-[90%] overflow-x-auto rounded-lg bg-foreground p-3",
message.role === Role.AI
? "justify-self-start"
: "justify-self-end",
Expand Down Expand Up @@ -121,8 +121,7 @@ export default function QueryForm({ workflowData }: WorkflowIdComponentProps) {
},
className:
"flex-grow px-3 py-2 text-sm border rounded-md w-full",
placeholder:
"How are commands in src/utils/commands.ts used?",
placeholder: "Ask anything",
disabled: isMessageLoading,
}}
/>
Expand Down
Loading