diff --git a/web/src/pages/NotifyChannelConfigControls.tsx b/web/src/pages/NotifyChannelConfigControls.tsx new file mode 100644 index 0000000..35d8350 --- /dev/null +++ b/web/src/pages/NotifyChannelConfigControls.tsx @@ -0,0 +1,97 @@ +import { Field } from './NotifyChannelFormField' + +type ConfigControlProps = { + config: Record + updateConfig: (key: string, value: string) => void +} + +type ConfigInputProps = ConfigControlProps & { + label: string + name: string + placeholder?: string + required?: boolean + type?: string +} + +export function ConfigInput({ + config, + updateConfig, + label, + name, + placeholder, + required, + type, +}: ConfigInputProps) { + return ( + + updateConfig(name, event.target.value)} + /> + + ) +} + +type ConfigSelectProps = ConfigControlProps & { + label: string + name: string + options: Array<{ value: string; label: string }> + defaultValue?: string +} + +export function ConfigSelect({ + config, + updateConfig, + label, + name, + options, + defaultValue = '', +}: ConfigSelectProps) { + return ( + + + + ) +} + +type ConfigTextareaProps = ConfigControlProps & { + label: string + name: string + placeholder?: string + rows: number +} + +export function ConfigTextarea({ + config, + updateConfig, + label, + name, + placeholder, + rows, +}: ConfigTextareaProps) { + return ( + +