import type { ReactNode } from 'react'; import type React from 'react'; import { useState } from 'react'; import { HiUsers } from 'react-icons/hi2'; import { Button } from '@wener/console/daisy'; import { clsx } from 'clsx'; export interface DockUserAvatarProps { hasNotification?: boolean; onSignIn?: () => void; onSignOut?: () => void; fullName?: string; loginName?: string; avatarUrl?: string; actions?: ReactNode; children?: ReactNode; } export const DockUserAvatar: React.FC = ({ hasNotification, fullName, loginName, avatarUrl, onSignIn, onSignOut, actions, children, }) => { const [isOpen, setIsOpen] = useState(false); if (!loginName) { return ( ); } return (
setIsOpen(!isOpen)} >
{avatarUrl ? (
{fullName
) : (
{fullName?.slice(0, 1)}
)}
{isOpen && (
{children}
)}
); };