- {(['all', 'troubleshooting', 'procedural', 'maintenance'] as const).map((t) => (
+ {/* Type filter tabs — includes Drafts as a first-class filter */}
+
+ {(['all', 'troubleshooting', 'procedural', 'maintenance', 'drafts'] as const).map((t) => {
+ const isActive = t === 'drafts' ? showDrafts && typeFilter === 'all' : !showDrafts && typeFilter === t
+ return (
setTypeFilter(t)}
+ onClick={() => {
+ if (t === 'drafts') {
+ setShowDrafts(true)
+ setTypeFilter('all')
+ } else {
+ setShowDrafts(false)
+ setTypeFilter(t)
+ }
+ }}
className={cn(
'rounded-md px-3 py-1 text-xs font-medium transition-colors',
- typeFilter === t
+ isActive
? 'bg-accent text-foreground'
: 'text-muted-foreground hover:text-foreground'
)}
>
- {t === 'all' ? 'All' : t === 'troubleshooting' ? 'Troubleshooting' : t === 'procedural' ? 'Projects' : 'Maintenance'}
+ {t === 'all' ? 'All' : t === 'troubleshooting' ? 'Troubleshooting' : t === 'procedural' ? 'Projects' : t === 'maintenance' ? 'Maintenance' : 'Drafts'}
- ))}
-
-
-
- setShowDrafts(e.target.checked)}
- className="h-4 w-4 rounded border-border text-primary focus:ring-2 focus:ring-primary/20 focus:ring-offset-2"
- />
- Show my drafts
-
+ )
+ })}
+