-
- {/* eslint-disable-next-line @next/next/no-img-element */}
-

{
- e.currentTarget.style.display = "none";
- }}
- />
+ {callbackConfigs.map((callbackConfig) => {
+ const logo = callbackConfig.logo;
+ const logoSrc =
+ logo && (logo.includes("/") || logo.startsWith("data:") || logo.startsWith("http"))
+ ? logo
+ : `${assetsLogoFolder}${logo}`;
+
+ return (
+
+
+
+ {/* eslint-disable-next-line @next/next/no-img-element */}
+

{
+ e.currentTarget.style.display = "none";
+ }}
+ />
+
+
{callbackConfig.displayName}
- {callbackConfig.displayName}
-
-
- ))}
+
+ );
+ })}
{selectedCallbackParams && selectedCallbackParams.length > 0 && (
{selectedCallbackParams.map((param) => {
- // Get the callback configuration to look up parameter types
- const callbackConfig = getCallbackById(selectedCallback || "");
- const paramType = callbackConfig?.dynamic_params[param] || "text";
-
- const fieldLabel = param.replace(/_/g, " ").replace(/\b\w/g, (l) => l.toUpperCase());
+ const callbackConfig = callbackConfigs.find((config) => config.id === selectedCallback);
+ const paramConfig = callbackConfig?.dynamic_params?.[param] || {};
+ const paramType = paramConfig.type || "text";
+ const fieldLabel =
+ paramConfig.ui_name || param.replace(/_/g, " ").replace(/\b\w/g, (l) => l.toUpperCase());
+ const isRequired = paramConfig.required || false;
return (
- {fieldLabel}
- *
-
- }
+ label={{fieldLabel} }
name={param}
key={param}
className="mb-4"
- rules={[
- {
- required: true,
- message: `Please enter the ${fieldLabel.toLowerCase()}`,
- },
- ]}
+ rules={
+ isRequired
+ ? [
+ {
+ required: true,
+ message: `Please enter the ${fieldLabel.toLowerCase()}`,
+ },
+ ]
+ : undefined
+ }
>
{paramType === "password" ? (