From e371759af6c218f18edc7a7dca8ba7b55cc367fb Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Sat, 17 Apr 2021 14:55:08 +0300
Subject: feat: initialize filters based on query string

---
 src/lib/ServiceContext.tsx | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

(limited to 'src/lib/ServiceContext.tsx')

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>>;
-- 
cgit v1.2.3

