summaryrefslogtreecommitdiff
path: root/src/containers/Service/ServiceContext.tsx
blob: b4200a08ee919d8f399a7cb5bf6ffa9c13c3d02d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import React from 'react';
import { FormikProps } from 'formik';

export interface PanelProps {
  item: any;
}

export interface ServiceParams {
  route: string;
  name: string;
  nameSingular: string;
  tableFields: any[];
  default: Record<string, any>;
  Form?: React.FC<FormikProps>;
  Panel?: React.FC<PanelProps>;
}

const ServiceContext = React.createContext<ServiceParams>({
  route: '',
  name: '',
  nameSingular: '',
  tableFields: [],
  default: {},
});

export const ServiceProvider = ServiceContext.Provider;
export default ServiceContext;