summaryrefslogtreecommitdiff
path: root/src/containers/Page.tsx
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2021-03-14 03:03:12 +0300
committereug-vs <eug-vs@keemail.me>2021-03-14 03:03:12 +0300
commite1fc8ea5904de90f94d3f63287555c75067846ac (patch)
tree0046cb821cba9153a202ab7e21f291b69bafe926 /src/containers/Page.tsx
parent64a537425a05a15ecfac3bf314735876dbbd8ed7 (diff)
downloadcommercel-ui-e1fc8ea5904de90f94d3f63287555c75067846ac.tar.gz
feat: add Page component
Diffstat (limited to 'src/containers/Page.tsx')
-rw-r--r--src/containers/Page.tsx25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/containers/Page.tsx b/src/containers/Page.tsx
new file mode 100644
index 0000000..0c8269e
--- /dev/null
+++ b/src/containers/Page.tsx
@@ -0,0 +1,25 @@
+import React from 'react';
+import Paper from '../components/Paper';
+import Button from '../components/Button';
+
+interface Action {
+ name: string;
+ route: string;
+}
+
+interface Props {
+ title: string;
+ actions?: Action[];
+}
+
+const Page: React.FC<Props> = ({ title, actions, children }) => (
+ <Paper>
+ <div className="mb-2 flex justify-between items-center">
+ <span className="text-2xl font-bold">{title}</span>
+ {actions?.map(action => (<Button size="sm" route={action.route}>{action.name}</Button>))}
+ </div>
+ {children}
+ </Paper>
+);
+
+export default Page;