|
1 | 1 | import { FormContext } from "../hooks/form-context"; |
2 | 2 | import { FormFieldContext } from "../hooks/form-field-context"; |
3 | | -import { ConfigurableProp } from "@pipedream/sdk"; |
| 3 | +import { ConfigurableProp, ConfigurableProps } from "@pipedream/sdk"; |
4 | 4 | // import { ControlAny } from "./ControlAny" |
5 | 5 | import { ControlApp } from "./ControlApp"; |
6 | 6 | import { ControlBoolean } from "./ControlBoolean"; |
7 | 7 | import { ControlInput } from "./ControlInput"; |
8 | 8 | import { ControlSelect } from "./ControlSelect"; |
9 | 9 | import { RemoteOptionsContainer } from "./RemoteOptionsContainer"; |
10 | 10 |
|
11 | | -export type ControlProps<T extends ConfigurableProp> = { |
12 | | - field: FormFieldContext<T>; |
13 | | - form: FormContext; |
| 11 | +export type ControlProps<T extends ConfigurableProps, U extends ConfigurableProp> = { |
| 12 | + field: FormFieldContext<U>; |
| 13 | + form: FormContext<T>; |
14 | 14 | }; |
15 | 15 |
|
16 | 16 | // TODO for easier Control* overriding, should probably pass more stuff in so they don't need to reach into context? |
17 | 17 | // ... or do we want the API to incentivize just reaching into context? |
18 | | -export function Control<T extends ConfigurableProp>(props: ControlProps<T>) { |
| 18 | +export function Control<T extends ConfigurableProps, U extends ConfigurableProp>(props: ControlProps<T, U>) { |
19 | 19 | const { |
20 | 20 | field, form, |
21 | 21 | } = props; |
@@ -63,7 +63,7 @@ export function Control<T extends ConfigurableProp>(props: ControlProps<T>) { |
63 | 63 | // case "any": |
64 | 64 | // return <ControlAny /> |
65 | 65 | case "app": |
66 | | - return <ControlApp app={app} />; |
| 66 | + return <ControlApp app={app!} />; |
67 | 67 | case "boolean": |
68 | 68 | return <ControlBoolean />; |
69 | 69 | case "string": |
|
0 commit comments