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/containers/Page.tsx | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

(limited to 'src/containers/Page.tsx')

diff --git a/src/containers/Page.tsx b/src/containers/Page.tsx
index d659510..467e458 100644
--- a/src/containers/Page.tsx
+++ b/src/containers/Page.tsx
@@ -1,13 +1,8 @@
 import React from 'react';
 import Paper from '../components/Paper';
 import Button from '../components/Button';
-import { Action } from '../lib/ServiceContext';
-import { Option, SelectBase } from '../components/Select';
-import { Field } from '../components/ListTable';
-
-export interface Filter extends Field {
-  options?: Option[];
-}
+import { Action, Filter } from '../lib/ServiceContext';
+import { SelectBase } from '../components/Select';
 
 interface Props {
   title?: string;
@@ -25,7 +20,9 @@ const Page: React.FC<Props> = ({ title, actions, filters, className, children })
         <span className="text-2xl font-bold">{title}</span>
         <div className="flex">
           <div className="mr-6 flex">
-            {filters?.map(filter => (<SelectBase key={filter.key} options={filter.options || []} />))}
+            {filters?.map(filter => (
+              <SelectBase key={filter.key} options={filter.options || []} value={filter.value} />
+            ))}
           </div>
           <div>
             {actions?.map(action => (<Button {...action} key={action.name} size="sm">{action.name}</Button>))}
-- 
cgit v1.2.3

