diff --git a/fakemui/react/components/email/navigation/AccountTabs.tsx b/fakemui/react/components/email/navigation/AccountTabs.tsx new file mode 100644 index 000000000..f584370a2 --- /dev/null +++ b/fakemui/react/components/email/navigation/AccountTabs.tsx @@ -0,0 +1,54 @@ +import React, { forwardRef } from 'react' +import { Tabs, Tab, TabsProps } from '../..' +import { useAccessible } from '@metabuilder/fakemui/hooks' + +export interface EmailAccount { + id: string + accountName: string + emailAddress: string + unreadCount?: number +} + +export interface AccountTabsProps extends Omit { + accounts: EmailAccount[] + selectedAccountId?: string + onSelectAccount?: (accountId: string) => void + testId?: string +} + +export const AccountTabs = forwardRef( + ({ accounts, selectedAccountId, onSelectAccount, testId: customTestId, ...props }, ref) => { + const accessible = useAccessible({ + feature: 'email', + component: 'account-tabs', + identifier: customTestId || 'accounts' + }) + + return ( + onSelectAccount?.(value as string)} + {...accessible} + {...props} + > + {accounts.map((account) => ( + + {account.accountName} + {account.unreadCount ? ( + {account.unreadCount} + ) : null} + + } + value={account.id} + /> + ))} + + ) + } +) + +AccountTabs.displayName = 'AccountTabs' diff --git a/fakemui/react/components/email/navigation/FolderNavigation.tsx b/fakemui/react/components/email/navigation/FolderNavigation.tsx new file mode 100644 index 000000000..896762dff --- /dev/null +++ b/fakemui/react/components/email/navigation/FolderNavigation.tsx @@ -0,0 +1,56 @@ +import React, { forwardRef } from 'react' +import { Box, BoxProps, Button } from '../..' +import { useAccessible } from '@metabuilder/fakemui/hooks' + +export interface FolderNavigationItem { + id: string + label: string + icon?: string + unreadCount?: number + isActive?: boolean +} + +export interface FolderNavigationProps extends BoxProps { + items: FolderNavigationItem[] + onNavigate?: (itemId: string) => void + testId?: string +} + +export const FolderNavigation = forwardRef( + ({ items, onNavigate, testId: customTestId, ...props }, ref) => { + const accessible = useAccessible({ + feature: 'email', + component: 'folder-nav', + identifier: customTestId || 'folders' + }) + + return ( + + + + ) + } +) + +FolderNavigation.displayName = 'FolderNavigation' diff --git a/fakemui/react/components/email/navigation/index.ts b/fakemui/react/components/email/navigation/index.ts new file mode 100644 index 000000000..4832b3037 --- /dev/null +++ b/fakemui/react/components/email/navigation/index.ts @@ -0,0 +1,2 @@ +export { AccountTabs, type AccountTabsProps, type EmailAccount } from './AccountTabs' +export { FolderNavigation, type FolderNavigationProps, type FolderNavigationItem } from './FolderNavigation'