mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
* fix: release.yml * fix: S3ChannelConfigSchema type port mismatch * fix(csp): Conditionally sets UPGRADE_INSECURE_REQUESTS based on the PROJECT_URL scheme. * chore: fix bug in github action. * chore: fix bug in github action. * chore: fix bug in github action. * chore: fix bug in github action. * chore: fix bug in github action. * chore: fix bug in github action. * chore: fix bug in github action. * chore: fix bug in github action. * chore: fix bug in github action. * chore: fix bug in github action. * chore: fix bug in github action. * chore: fix bug in github action. * chore: fix bug in github action. * chore: fix bug in github action. * chore: fix bug in github action. * chore: fix bug in github action. * chore: adding e2e tesing for notification. * fix: updating trivy-action to the latest version, using new tagging pattern (vX.XX.XX instead of (X.XX.XX). * fix: removing browser targeting in e2e workflow as it is already specify in playwright.config.ts * fix: mapping secrets to environment variables in the end-to-end workflow. * fix: add a condition to allow end-to-end workflow execution only on main repo (fork are excluded). * fix: adding some data-testid to rely on more stable locator. * fix: adding some data-testid to rely on more stable locator. * fix: removing unusued browsers in end-to-end workflow. * fix: removing unused browsers in end-to-end workflow. * fix: removing unused browsers in end-to-end workflow. --------- Co-authored-by: charlesgauthereau <charles.gauthereau@soluce-technologies.com> Co-authored-by: killianlarcher <killian.larcher@soluce-technologies.com>
49 lines
1.9 KiB
TypeScript
49 lines
1.9 KiB
TypeScript
"use client";
|
|
|
|
import { ChevronsUpDown } from "lucide-react";
|
|
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
|
|
import { SidebarMenuButton } from "@/components/ui/sidebar";
|
|
import { LoggedInDropdown } from "./logged-in-dropdown";
|
|
import { Account, Session, User } from "better-auth";
|
|
import { AuthProviderConfig } from "@/lib/auth/config";
|
|
|
|
type LoggedInButtonClientProps = {
|
|
user: User;
|
|
sessions: Session[];
|
|
currentSession: Session;
|
|
accounts: Account[];
|
|
providers: AuthProviderConfig[];
|
|
};
|
|
|
|
export const LoggedInButtonClient = ({ user, sessions, currentSession, accounts, providers }: LoggedInButtonClientProps) => {
|
|
return (
|
|
<LoggedInDropdown
|
|
// @ts-ignore
|
|
user={user}
|
|
// @ts-ignore
|
|
sessions={sessions}
|
|
// @ts-ignore
|
|
currentSession={currentSession}
|
|
// @ts-ignore
|
|
accounts={accounts}
|
|
providers={providers}
|
|
>
|
|
<SidebarMenuButton type="button" className="h-auto justify-between py-2" data-testid="profile-dropdown">
|
|
<div className="flex items-center gap-2">
|
|
<Avatar className="size-6">
|
|
<AvatarFallback>{user.name[0].toUpperCase()}</AvatarFallback>
|
|
{user.image && <AvatarImage src={user.image} />}
|
|
</Avatar>
|
|
<div className="flex flex-col items-start">
|
|
<span className="text-sm font-medium first-letter:capitalize max-w-[170px] truncate">{user.name}</span>
|
|
<span className="text-xs text-muted-foreground max-w-[170px] truncate" title={user.email}>
|
|
{user.email}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<ChevronsUpDown className="h-4 w-4 shrink-0 opacity-50" />
|
|
</SidebarMenuButton>
|
|
</LoggedInDropdown>
|
|
);
|
|
};
|