fix(logbook): 'All' filter shows every log including system entries

Drop the 'non-system' default filter; 'All' now means all log types.
This commit is contained in:
Brückner
2026-06-09 13:09:04 +02:00
parent 2a2902d5bc
commit a2d515992c

View File

@ -20,7 +20,7 @@ interface LogbookProps {
export default function Logbook({ logs, devices, users, currentUser, onAddLog }: LogbookProps) {
const [searchTerm, setSearchTerm] = useState('');
const [typeFilter, setTypeFilter] = useState<string>('non-system');
const [typeFilter, setTypeFilter] = useState<string>('all');
// Custom Maintenance Log state
const [showAddLog, setShowAddLog] = useState(false);
@ -35,7 +35,6 @@ export default function Logbook({ logs, devices, users, currentUser, onAddLog }:
const matchesSearch = log.message.toLowerCase().includes(searchTerm.toLowerCase());
const matchesType =
typeFilter === 'all' ? true :
typeFilter === 'non-system' ? log.type !== 'system' :
log.type === typeFilter;
return matchesSearch && matchesType;
});
@ -126,7 +125,7 @@ export default function Logbook({ logs, devices, users, currentUser, onAddLog }:
</div>
<div className="flex gap-1 shrink-0 text-xs font-medium flex-wrap">
{[
{ key: 'non-system', label: 'All' },
{ key: 'all', label: 'All' },
{ key: 'booking', label: 'Booking' },
{ key: 'maintenance',label: 'Maintenance' },
{ key: 'status', label: 'Status' },