mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 13:54:57 +00:00
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>
64 lines
1.8 KiB
TypeScript
64 lines
1.8 KiB
TypeScript
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>
|
||
)
|
||
}
|