Skip to content

Commit 34dda40

Browse files
committed
added sheet-selector to tool-input
1 parent 4d1080d commit 34dda40

File tree

1 file changed

+51
-0
lines changed
  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input

1 file changed

+51
-0
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import {
3838
FileUpload,
3939
LongInput,
4040
ProjectSelectorInput,
41+
SheetSelectorInput,
4142
ShortInput,
4243
SlackSelectorInput,
4344
SliderInput,
@@ -263,6 +264,43 @@ function FileSelectorSyncWrapper({
263264
)
264265
}
265266

267+
function SheetSelectorSyncWrapper({
268+
blockId,
269+
paramId,
270+
value,
271+
onChange,
272+
uiComponent,
273+
disabled,
274+
previewContextValues,
275+
}: {
276+
blockId: string
277+
paramId: string
278+
value: string
279+
onChange: (value: string) => void
280+
uiComponent: any
281+
disabled: boolean
282+
previewContextValues?: Record<string, any>
283+
}) {
284+
return (
285+
<GenericSyncWrapper blockId={blockId} paramId={paramId} value={value} onChange={onChange}>
286+
<SheetSelectorInput
287+
blockId={blockId}
288+
subBlock={{
289+
id: paramId,
290+
type: 'sheet-selector' as const,
291+
title: paramId,
292+
serviceId: uiComponent.serviceId,
293+
requiredScopes: uiComponent.requiredScopes || [],
294+
placeholder: uiComponent.placeholder,
295+
dependsOn: uiComponent.dependsOn,
296+
}}
297+
disabled={disabled}
298+
previewContextValues={previewContextValues}
299+
/>
300+
</GenericSyncWrapper>
301+
)
302+
}
303+
266304
function KnowledgeBaseSelectorSyncWrapper({
267305
blockId,
268306
paramId,
@@ -2026,6 +2064,19 @@ export function ToolInput({
20262064
/>
20272065
)
20282066

2067+
case 'sheet-selector':
2068+
return (
2069+
<SheetSelectorSyncWrapper
2070+
blockId={blockId}
2071+
paramId={param.id}
2072+
value={value}
2073+
onChange={onChange}
2074+
uiComponent={uiComponent}
2075+
disabled={disabled}
2076+
previewContextValues={currentToolParams as any}
2077+
/>
2078+
)
2079+
20292080
case 'table':
20302081
return (
20312082
<TableSyncWrapper

0 commit comments

Comments
 (0)