Search/Filter panel moments
Intro
1. Any time you want to do filter for organizations
You just do the below and it'll take care of the rough surface for you
<FilterOrganization
organization_id={
searchParams.get(URLMapper["organization_id"]) as string
}
data_holder="organization_id"
handleChange={handleQueryChange}
/>
2. Anytime you want select tool which respect the search feature just do this
<NormalSelect
label="Status"
items={["Any", "Valid", "Cancelled"]}
value={searchParams.get(URLMapper["receipt_status"]) as string}
onChange={(e: any) => {
if (e.target.value === "Any")
handleQueryChange("receipt_status", null);
handleQueryChange("receipt_status", e.target.value);
}}
/>
3. Anytime you want to select/search account just do this
<FilterAccount
label="Accounts"
data_holder="account_id"
handleChange={handleQueryChange}
account_id={searchParams.get(URLMapper["account_id"]) as string}
/>
4. We can filter select expense category
<FilterExpenseCategory
label="Expense Category"
data_holder="ec_id"
ec_id={searchParams.get(URLMapper["ec_id"]) as string}
handleChange={handleQueryChange}
size="col-sm-4 mt-2"
/>
5. What about user on the filter field
<FilterUser
user_id={searchParams.get(URLMapper["user_id"]) as string}
handleChange={handleQueryChange}
data_holder="user_id"
/>