diff options
Diffstat (limited to 'src/lib/ServiceContext.tsx')
-rw-r--r-- | src/lib/ServiceContext.tsx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/ServiceContext.tsx b/src/lib/ServiceContext.tsx index 93cac4e..f7170d1 100644 --- a/src/lib/ServiceContext.tsx +++ b/src/lib/ServiceContext.tsx @@ -7,22 +7,22 @@ export interface Action extends ButtonProps { name: string; } -export interface PanelProps { - item: any; - mutate: (item: any) => void; +export interface PanelProps<T> { + item: T; + mutate: (item: T) => void; } -export interface ServiceParams { +export interface ServiceParams<T = any> { route: string; name: string; tableFields: Field[]; nameSingular?: string; - default?: Record<string, any>; + default?: Partial<T>; routes?: Record<string, React.FC>; actions?: Action[]; - rowLink?: (item: any) => string; - Form?: React.FC<FormikProps<any>>; - Panel?: React.FC<PanelProps>; + rowLink?: (item: T) => string; + Form?: React.FC<FormikProps<T>>; + Panel?: React.FC<PanelProps<T>>; } const ServiceContext = React.createContext<ServiceParams>({ |