Skip to content

Commit f9e4092

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
improvement(ui): use chip fields in workflow search and replace
1 parent 81e3110 commit f9e4092

4 files changed

Lines changed: 25 additions & 23 deletions

File tree

‎apps/sim/app/(interfaces)/chat/components/error-state/error-state.tsx‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client'
22

3-
import { Button, StatusPageContent } from '@sim/emcn'
3+
import { Chip, StatusPageContent } from '@sim/emcn'
44
import { useRouter } from 'next/navigation'
55
import { APP_ENTRY_PATH } from '@/lib/navigation/paths'
66

@@ -14,14 +14,15 @@ export function ChatErrorState({ error }: ChatErrorStateProps) {
1414
return (
1515
<div className='flex flex-1 items-center justify-center px-4 py-16 text-center'>
1616
<StatusPageContent title='Chat Unavailable' description={error}>
17-
<Button
18-
type='button'
17+
<Chip
1918
variant='primary'
20-
className='h-[32px] w-full gap-2 px-2.5 text-sm'
2119
onClick={() => router.push(APP_ENTRY_PATH)}
20+
fullWidth
21+
type='button'
22+
className='text-center'
2223
>
2324
Open Sim
24-
</Button>
25+
</Chip>
2526
</StatusPageContent>
2627
</div>
2728
)

‎apps/sim/app/(interfaces)/resume/[workflowId]/[executionId]/resume-page-client.tsx‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -781,17 +781,18 @@ export default function ResumeExecutionPage({
781781
</div>
782782
<Tooltip.Root>
783783
<Tooltip.Trigger asChild>
784-
<Button
784+
<Chip
785785
variant='outline'
786-
size='sm'
786+
type='button'
787787
onClick={handleRefreshExecution}
788788
disabled={refreshingExecution}
789-
className='gap-1.5 px-2.5'
789+
leftAdornment={
790+
<RefreshCw className={cn('size-[14px]', refreshingExecution && 'animate-spin')} />
791+
}
790792
aria-label='Refresh execution details'
791793
>
792-
<RefreshCw className={cn('size-[14px]', refreshingExecution && 'animate-spin')} />
793794
Refresh
794-
</Button>
795+
</Chip>
795796
</Tooltip.Trigger>
796797
<Tooltip.Content>Refresh</Tooltip.Content>
797798
</Tooltip.Root>

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/search-replace/components/replacement-controls/replacement-controls.tsx‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client'
22

3-
import { Button, Combobox, Input } from '@sim/emcn'
3+
import { Chip, ChipCombobox, ChipInput } from '@sim/emcn'
44
import type { WorkflowSearchReplacementOption } from '@/lib/workflows/search-replace/types'
55

66
interface ReplacementControlsProps {
@@ -33,7 +33,7 @@ export function ReplacementControls({
3333
return (
3434
<div className='space-y-2'>
3535
{usesResourceReplacement ? (
36-
<Combobox
36+
<ChipCombobox
3737
options={compatibleResourceOptions.map((option) => ({
3838
label: option.label,
3939
value: option.value,
@@ -47,7 +47,7 @@ export function ReplacementControls({
4747
disabled={disabled || compatibleResourceOptions.length === 0}
4848
/>
4949
) : (
50-
<Input
50+
<ChipInput
5151
value={replacement}
5252
placeholder='Replace'
5353
disabled={disabled}
@@ -60,22 +60,22 @@ export function ReplacementControls({
6060
{eligibleCount} replaceable match{eligibleCount === 1 ? '' : 'es'}
6161
</span>
6262
<div className='flex gap-1.5'>
63-
<Button
64-
className='h-8 text-xs'
65-
variant='default'
63+
<Chip
64+
type='button'
65+
variant='outline'
6666
disabled={disabled || isApplying || !canReplaceActive}
6767
onClick={onReplaceActive}
6868
>
6969
Replace
70-
</Button>
71-
<Button
72-
className='h-8 text-xs'
73-
variant='active'
70+
</Chip>
71+
<Chip
72+
type='button'
73+
active
7474
disabled={disabled || isApplying || !canReplaceAll}
7575
onClick={onReplaceAll}
7676
>
7777
{isApplying ? 'Replacing...' : 'Replace All'}
78-
</Button>
78+
</Chip>
7979
</div>
8080
</div>
8181
</div>

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/search-replace/workflow-search-replace.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client'
22

33
import { type RefObject, useCallback, useEffect, useMemo, useRef, useState } from 'react'
4-
import { Button, cn, Input, toast } from '@sim/emcn'
4+
import { Button, ChipInput, cn, toast } from '@sim/emcn'
55
import { ChevronDown, ChevronRight, ChevronUp, X } from '@sim/emcn/icons'
66
import { useParams } from 'next/navigation'
77
import { useShallow } from 'zustand/react/shallow'
@@ -600,7 +600,7 @@ function WorkflowSearchReplacePanel({ focusRef }: WorkflowSearchReplacePanelProp
600600
)}
601601
/>
602602
</Button>
603-
<Input
603+
<ChipInput
604604
ref={searchInputRef}
605605
value={query}
606606
placeholder='Search'

0 commit comments

Comments
 (0)