export const useSearch = (searchString,items) => {
    if(!searchString) {
        return items
    }

    return items.filter(i => JSON.stringify(i).toLowerCase().includes(searchString.toLowerCase()))
}

export const useListFilter = (searchString,items,showArchived = false) => {
    if(!searchString) {
        return items.filter(i => !i.archived)
    }

    return items.filter(i => JSON.stringify(i).toLowerCase().includes(searchString.toLowerCase()) && !i.archived)
}