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

{
- e.currentTarget.style.display = 'none';
- }}
- />
-
-
- {callbackConfig.displayName}
-
+ {CALLBACK_CONFIGS.map((callbackConfig) => (
+
+
+
+ {/* eslint-disable-next-line @next/next/no-img-element */}
+

{
+ e.currentTarget.style.display = "none";
+ }}
+ />
-
- ))}
-
-
+
{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());
-
- return (
-
- {fieldLabel}
- *
-
- }
- name={param}
- key={param}
- className="mb-4"
- rules={[
- {
- required: true,
- message: `Please enter the ${fieldLabel.toLowerCase()}`,
- },
- ]}
- >
- {paramType === "password" ? (
-
- ) : paramType === "number" ? (
-
- ) : (
-
- )}
-
- );
- })}
-
- )}
+ {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";
-
-
-
- Add Callback
-
+ const fieldLabel = param.replace(/_/g, " ").replace(/\b\w/g, (l) => l.toUpperCase());
+
+ return (
+
+ {fieldLabel}
+ *
+
+ }
+ name={param}
+ key={param}
+ className="mb-4"
+ rules={[
+ {
+ required: true,
+ message: `Please enter the ${fieldLabel.toLowerCase()}`,
+ },
+ ]}
+ >
+ {paramType === "password" ? (
+
+ ) : paramType === "number" ? (
+
+ ) : (
+
+ )}
+
+ );
+ })}
+ )}
+
+
+
+ Add Callback
+
diff --git a/ui/litellm-dashboard/src/utils/textUtils.test.ts b/ui/litellm-dashboard/src/utils/textUtils.test.ts
new file mode 100644
index 00000000000..2a036104b58
--- /dev/null
+++ b/ui/litellm-dashboard/src/utils/textUtils.test.ts
@@ -0,0 +1,8 @@
+import { describe, it, expect } from "vitest";
+import { formatLabel } from "./textUtils";
+
+describe("textUtils", () => {
+ it("should format label", () => {
+ expect(formatLabel("test_label")).toBe("Test Label");
+ });
+});
diff --git a/ui/litellm-dashboard/src/utils/textUtils.ts b/ui/litellm-dashboard/src/utils/textUtils.ts
new file mode 100644
index 00000000000..07c4583d3ff
--- /dev/null
+++ b/ui/litellm-dashboard/src/utils/textUtils.ts
@@ -0,0 +1,8 @@
+export const formatLabel = (text: string): string => {
+ if (!text) {
+ return text;
+ }
+
+ const withSpaces = text.replace(/_/g, " ");
+ return withSpaces.replace(/\b\w/g, (char) => char.toUpperCase());
+};