|
1
|
import React from "react" |
|
2
|
import { ApiRunnerParamInput } from "./Default" |
|
3
|
|
|
4
|
export type ApiRunnerParamInputsProps = { |
|
5
|
data: Record<string, unknown> |
|
6
|
title: string |
|
7
|
baseObjPath: string |
|
8
|
setValue: React.Dispatch<React.SetStateAction<unknown>> |
|
9
|
} |
|
10
|
|
|
11
|
export const ApiRunnerParamInputs = ({ |
|
12
|
data, |
|
13
|
title, |
|
14
|
baseObjPath, |
|
15
|
setValue, |
|
16
|
}: ApiRunnerParamInputsProps) => { |
|
17
|
return ( |
|
18
|
<div className="flex flex-col gap-docs_0.25 w-full"> |
|
19
|
<span className="txt-small-plus text-medusa-fg-base">{title}</span> |
|
20
|
<div className="flex flex-col gap-docs_0.5"> |
|
21
|
{Object.keys(data).map((pathParam, index) => ( |
|
22
|
<ApiRunnerParamInput |
|
23
|
paramName={pathParam} |
|
24
|
paramValue={data[pathParam]} |
|
25
|
objPath={baseObjPath} |
|
26
|
setValue={setValue} |
|
27
|
key={index} |
|
28
|
/> |
|
29
|
))} |
|
30
|
</div> |
|
31
|
</div> |
|
32
|
) |
|
33
|
} |