diff options
author | eug-vs <eug-vs@keemail.me> | 2021-04-17 14:55:08 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2021-04-17 14:55:08 +0300 |
commit | e371759af6c218f18edc7a7dca8ba7b55cc367fb (patch) | |
tree | 1561efd44de6f015ef54edd66884e65463160aa8 /src/lib/ServiceContext.tsx | |
parent | 1bf07892f2cd8007f48469c42fa9fcc84d5ef435 (diff) | |
download | commercel-ui-e371759af6c218f18edc7a7dca8ba7b55cc367fb.tar.gz |
feat: initialize filters based on query string
Diffstat (limited to 'src/lib/ServiceContext.tsx')
-rw-r--r-- | src/lib/ServiceContext.tsx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/ServiceContext.tsx b/src/lib/ServiceContext.tsx index 67f3756..2001d00 100644 --- a/src/lib/ServiceContext.tsx +++ b/src/lib/ServiceContext.tsx @@ -2,11 +2,18 @@ import React from 'react'; import { FormikProps } from 'formik'; import { Props as ButtonProps } from '../components/Button'; import { Field } from '../components/ListTable'; +import { Option } from '../components/Select'; export interface Action extends ButtonProps { name: string; } +export interface Filter extends Field { + as?: string; + options?: Option[]; + value?: string; +} + export interface PanelProps<T> { item: T; mutate: (item: T) => void; @@ -20,7 +27,7 @@ export interface ServiceParams<T = any> { default?: Partial<T>; routes?: Record<string, React.FC>; actions?: Action[]; - filters?: string[]; + filters?: Filter[]; rowLink?: (item: T) => string; Form?: React.FC<FormikProps<T>>; Panel?: React.FC<PanelProps<T>>; |