summaryrefslogtreecommitdiff
path: root/src/containers/Page.tsx
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2021-04-17 14:55:08 +0300
committereug-vs <eug-vs@keemail.me>2021-04-17 14:55:08 +0300
commite371759af6c218f18edc7a7dca8ba7b55cc367fb (patch)
tree1561efd44de6f015ef54edd66884e65463160aa8 /src/containers/Page.tsx
parent1bf07892f2cd8007f48469c42fa9fcc84d5ef435 (diff)
downloadcommercel-ui-e371759af6c218f18edc7a7dca8ba7b55cc367fb.tar.gz
feat: initialize filters based on query string
Diffstat (limited to 'src/containers/Page.tsx')
-rw-r--r--src/containers/Page.tsx13
1 files changed, 5 insertions, 8 deletions
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>))}