import React from 'react'; import { FormikProps } from 'formik'; import { Props as ButtonProps } from '../components/Button'; import { Field } from '../components/ListTable'; import { Option } from '../components/Select'; export interface Action extends ButtonProps { name: string; } export interface Filter extends Field { as?: string; date?: boolean; options?: Option[]; value?: string; } export interface PanelProps { item: T; mutate: (item: T) => void; } export interface ServiceParams { route: string; name: string; tableFields: Field[]; nameSingular?: string; default?: Partial; routes?: Record; actions?: Action[]; filters?: Filter[]; searchBy?: string[]; rowLink?: (item: T) => string; Form?: React.FC>; Panel?: React.FC>; } const ServiceContext = React.createContext({ route: '', name: '', nameSingular: '', tableFields: [], default: {}, }); export const ServiceProvider = ServiceContext.Provider; export default ServiceContext;