()
| 128 | /** Header toggle (mounted via the section's `Actions` slot). Segmented |
| 129 | * Time / Workspace switch. */ |
| 130 | export function InboxViewToggle() { |
| 131 | const { t } = useTranslation() |
| 132 | const mode = useInboxViewMode((s) => s.mode) |
| 133 | const setMode = useInboxViewMode((s) => s.setMode) |
| 134 | |
| 135 | return ( |
| 136 | <div className="flex items-center rounded-md border border-border/70 overflow-hidden"> |
| 137 | <ToggleBtn |
| 138 | active={mode === 'time'} |
| 139 | onClick={() => setMode('time')} |
| 140 | title={t('inbox.viewTime')} |
| 141 | > |
| 142 | <Clock size={13} strokeWidth={2} /> |
| 143 | </ToggleBtn> |
| 144 | <ToggleBtn |
| 145 | active={mode === 'workspace'} |
| 146 | onClick={() => setMode('workspace')} |
| 147 | title={t('inbox.viewWorkspace')} |
| 148 | > |
| 149 | <Layers size={13} strokeWidth={2} /> |
| 150 | </ToggleBtn> |
| 151 | </div> |
| 152 | ) |
| 153 | } |
| 154 | |
| 155 | function ToggleBtn({ |
| 156 | active, onClick, title, children, |
nothing calls this directly
no outgoing calls
no test coverage detected