Files
metabuilder/components/fakemui/email/layout/MailboxHeader.tsx
johndoe6345789 8c21105d72 refactor(emailclient): extract MailboxHeader, MailboxSidebar, EmailDetail components
Moves inline JSX from EmailClientContent into proper FakeMUI email
components in components/fakemui/email/layout/. All styling uses M3
CSS custom properties (--mat-sys-*) from the FakeMUI token system.

New components:
- MailboxHeader: top bar with search, avatar, settings
- MailboxSidebar: compose button + folder navigation
- EmailDetail: reading pane with toolbar, header, body, reply bar

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 14:52:58 +00:00

64 lines
1.8 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import React from 'react'
import { Box, BoxProps, IconButton, Typography } from '../..'
import { useAccessible } from '../../../../hooks/useAccessible'
export interface MailboxHeaderProps extends BoxProps {
appName?: string
appIcon?: string
searchQuery?: string
onSearchChange?: (query: string) => void
searchPlaceholder?: string
avatarLabel?: string
onSettingsClick?: () => void
testId?: string
}
export const MailboxHeader = ({
appName = 'MetaMail',
appIcon = '📧',
searchQuery = '',
onSearchChange,
searchPlaceholder = 'Search mail',
avatarLabel = 'U',
onSettingsClick,
testId: customTestId,
...props
}: MailboxHeaderProps) => {
const accessible = useAccessible({
feature: 'email',
component: 'mailbox-header',
identifier: customTestId || 'header'
})
return (
<Box className="mailbox-header-bar" {...accessible} {...props}>
<Box className="mailbox-header-brand">
<span className="mailbox-header-icon">{appIcon}</span>
<Typography variant="h6" className="mailbox-header-title">
{appName}
</Typography>
</Box>
<Box className="mailbox-header-search">
<input
type="search"
className="mailbox-search-input"
placeholder={searchPlaceholder}
value={searchQuery}
onChange={e => onSearchChange?.(e.target.value)}
aria-label={searchPlaceholder}
/>
</Box>
<Box className="mailbox-header-actions">
{onSettingsClick && (
<IconButton aria-label="Settings" title="Settings" onClick={onSettingsClick}>
<span className="mailbox-header-action-icon"></span>
</IconButton>
)}
<Box className="mailbox-header-avatar" aria-label="Account">
{avatarLabel}
</Box>
</Box>
</Box>
)
}