feat: add frontend/src/components/FolderTree.tsx
This commit is contained in:
parent
cc8ea14bf6
commit
e72fcd0ab1
30
frontend/src/components/FolderTree.tsx
Normal file
30
frontend/src/components/FolderTree.tsx
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import { useMailStore } from '../store/mailStore'
|
||||||
|
|
||||||
|
const FOLDER_ICONS: Record<string, string> = {
|
||||||
|
'INBOX': '📥', '받은메함': '📥',
|
||||||
|
'Sent': '📤', '보낸메함': '📤',
|
||||||
|
'Drafts': '📝', '임시보관함': '📝',
|
||||||
|
'Trash': '🗑️', '휴지통': '🗑️',
|
||||||
|
'Junk': '⚠️', 'Spam': '⚠️', '스팸': '⚠️',
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function FolderTree() {
|
||||||
|
const { folders, currentFolder, setCurrentFolder } = useMailStore()
|
||||||
|
|
||||||
|
return (
|
||||||
|
<nav className="folder-tree">
|
||||||
|
<div className="folder-tree-title">폴더</div>
|
||||||
|
{folders.map(f => (
|
||||||
|
<button
|
||||||
|
key={f.name}
|
||||||
|
className={`folder-item ${currentFolder === f.name ? 'active' : ''}`}
|
||||||
|
onClick={() => setCurrentFolder(f.name)}
|
||||||
|
>
|
||||||
|
<span className="folder-icon">{FOLDER_ICONS[f.name] || FOLDER_ICONS[f.display] || '📁'}</span>
|
||||||
|
<span className="folder-name">{f.display}</span>
|
||||||
|
{f.unread > 0 && <span className="folder-badge">{f.unread}</span>}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</nav>
|
||||||
|
)
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user