summaryrefslogtreecommitdiff
path: root/src/containers
diff options
context:
space:
mode:
Diffstat (limited to 'src/containers')
-rw-r--r--src/containers/Page.tsx7
-rw-r--r--src/containers/Service/ServiceContext.tsx13
-rw-r--r--src/containers/Service/ServiceItem.tsx4
3 files changed, 13 insertions, 11 deletions
diff --git a/src/containers/Page.tsx b/src/containers/Page.tsx
index d3a087a..73b122e 100644
--- a/src/containers/Page.tsx
+++ b/src/containers/Page.tsx
@@ -1,10 +1,7 @@
import React from 'react';
import Paper from '../components/Paper';
-import Button, { Props as ButtonProps } from '../components/Button';
-
-export interface Action extends ButtonProps {
- name: string;
-}
+import Button from '../components/Button';
+import { Action } from './Service/ServiceContext';
interface Props {
title?: string;
diff --git a/src/containers/Service/ServiceContext.tsx b/src/containers/Service/ServiceContext.tsx
index 75ac0fb..0cccc93 100644
--- a/src/containers/Service/ServiceContext.tsx
+++ b/src/containers/Service/ServiceContext.tsx
@@ -1,6 +1,11 @@
import React from 'react';
import { FormikProps } from 'formik';
-import { Action } from '../Page';
+import { Props as ButtonProps } from '../../components/Button';
+import { Field } from '../../components/ListTable';
+
+export interface Action extends ButtonProps {
+ name: string;
+}
export interface PanelProps {
item: any;
@@ -10,9 +15,9 @@ export interface PanelProps {
export interface ServiceParams {
route: string;
name: string;
- nameSingular: string;
- tableFields: any[];
- default: Record<string, any>;
+ nameSingular?: string;
+ tableFields: Field[];
+ default?: Record<string, any>;
routes?: Record<string, React.FC>;
actions?: Action[];
rowLink?: (item: any) => string;
diff --git a/src/containers/Service/ServiceItem.tsx b/src/containers/Service/ServiceItem.tsx
index f833227..0e24895 100644
--- a/src/containers/Service/ServiceItem.tsx
+++ b/src/containers/Service/ServiceItem.tsx
@@ -2,11 +2,11 @@ import React, { useContext } from 'react';
import { useParams, useHistory } from 'react-router-dom';
import { Formik } from 'formik';
import _ from 'lodash';
-import Page, { Action } from '../Page';
+import Page from '../Page';
import hooks from '../../hooks/useAPIClient';
import useQuery from '../../hooks/useQuery';
import { post, patch, del } from '../../requests';
-import ServiceContext from './ServiceContext';
+import ServiceContext, { Action } from './ServiceContext';
interface Params {
id: string;