diff options
Diffstat (limited to 'src/containers/Service')
-rw-r--r-- | src/containers/Service/ServiceContext.tsx | 13 | ||||
-rw-r--r-- | src/containers/Service/ServiceItem.tsx | 4 |
2 files changed, 11 insertions, 6 deletions
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; |