KI-AGENT: Share-Upload an FEDEO-Design und Listenfilter angleichen
This commit is contained in:
@@ -15,6 +15,7 @@ import {
|
||||
import { useRouter } from 'expo-router';
|
||||
|
||||
import { createCustomer, Customer, fetchCustomers } from '@/src/lib/api';
|
||||
import { filterCustomers } from '@/src/lib/resource-list-filters';
|
||||
import { useAuth } from '@/src/providers/auth-provider';
|
||||
|
||||
const PRIMARY = '#69c350';
|
||||
@@ -37,20 +38,10 @@ export default function CustomersScreen() {
|
||||
const [numberInput, setNumberInput] = useState('');
|
||||
const [notesInput, setNotesInput] = useState('');
|
||||
|
||||
const filtered = useMemo(() => {
|
||||
const terms = search.trim().toLowerCase().split(/\s+/).filter(Boolean);
|
||||
|
||||
return customers.filter((customer) => {
|
||||
if (!showArchived && customer.archived) return false;
|
||||
if (terms.length === 0) return true;
|
||||
|
||||
const haystack = [customer.name, customer.customerNumber, customer.notes]
|
||||
.map((value) => String(value || '').toLowerCase())
|
||||
.join(' ');
|
||||
|
||||
return terms.every((term) => haystack.includes(term));
|
||||
});
|
||||
}, [customers, search, showArchived]);
|
||||
const filtered = useMemo(
|
||||
() => filterCustomers(customers, search, showArchived),
|
||||
[customers, search, showArchived]
|
||||
);
|
||||
|
||||
const load = useCallback(async (showSpinner = true) => {
|
||||
if (!token) return;
|
||||
|
||||
Reference in New Issue
Block a user