+
toggleExpand(path)}>
+ {isExpanded ? '▼ ' : '▶ '} {formatArgumentName(path)}
+
+ {isExpanded && isList ? (
+
{renderListOfInputObjects(path, allArgs, nestedLevel, type)}
+ ) : isExpanded ? (
+ renderArgumentInputs(nestedArgs, nestedLevel, allArgs)
+ ) : null}
+
+
+ {type.subtype === 'Boolean' &&
+ (() => {
+ const currentValue = getNestedValue(tripQueryVariables, path) as boolean | undefined;
+ const isInUse = currentValue !== undefined;
+ return (
+
+ handleInputChange(path, e.target.checked)}
+ />
+ {isInUse && (
+ handleRemoveArgument(path)} className="remove-argument">
+ x
+
+ )}
+
+ );
+ })()}
+
+ {type.subtype != null &&
+ ['String', 'DoubleFunction', 'ID', 'Duration'].includes(type.subtype) &&
+ isList && (
+
{
+ const currentValue = getNestedValue(tripQueryVariables, path);
+ return Array.isArray(currentValue) ? currentValue.join(', ') : '';
+ })()}
+ onChange={(e) => handleInputChange(path, e.target.value)}
+ placeholder="Comma-separated list"
+ />
+ )}
+
+ {type.subtype != null &&
+ ['String', 'DoubleFunction', 'ID', 'Duration'].includes(type.subtype) &&
+ !isList && (
+
handleInputChange(path, e.target.value || undefined)}
+ />
+ )}
+
+ {type.subtype === 'Int' && (
+
{
+ const val = parseInt(e.target.value, 10);
+ handleInputChange(path, Number.isNaN(val) ? undefined : val);
+ }}
+ />
+ )}
+
+ {type.subtype === 'Float' && (
+
{
+ const val = parseFloat(e.target.value);
+ handleInputChange(path, Number.isNaN(val) ? undefined : val);
+ }}
+ />
+ )}
+
+ {type.subtype === 'DateTime' && (
+
{
+ const newValue = e.target.value ? new Date(e.target.value).toISOString() : undefined;
+ handleInputChange(path, newValue);
+ }}
+ />
+ )}
+
+ {type.type === 'Enum' && enumValues && isList && (
+
+ )}
+
+ {type.type === 'Enum' && enumValues && !isList && (
+
+ )}
+