import React, { forwardRef } from 'react' import { Icon, IconButton, IconButtonProps } from '@chakra-ui/react' import { HiBell } from 'react-icons/hi' import { UnreadBadge } from './unread-badge' export interface NotificationsTriggerTheme { color?: string bg?: string activeColor?: string activeBg?: string hoverColor?: string hoverBg?: string } export const defaultNotificationsTriggerTheme: NotificationsTriggerTheme = { color: 'black', bg: 'gray.100', activeColor: 'blue.500', activeBg: 'blue.100', hoverBg: 'gray.200', } export type NotificationsTriggerProps = Omit & { theme?: NotificationsTriggerTheme isLoading?: boolean unreadCount?: number } export const NotificationsMenuTrigger = forwardRef( ({ children, theme = defaultNotificationsTriggerTheme, unreadCount = 0, isLoading, ...props }, ref) => { return ( } icon={ <> } borderRadius="full" color={theme?.color} bgColor={theme?.bg} _active={{ bgColor: theme?.activeBg, color: theme?.activeColor, }} _hover={{ color: theme?.hoverColor, bgColor: theme?.hoverBg, }} data-action="notifications-menu" {...props} /> ) } )