Skip to content

Commit bacc6a4

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
improvement(ui): reuse chip for PII configuration action
1 parent cfa8a5c commit bacc6a4

1 file changed

Lines changed: 14 additions & 17 deletions

File tree

  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/grouped-checkbox-list

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/grouped-checkbox-list/grouped-checkbox-list.tsx‎

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import { useEffect, useMemo, useRef, useState } from 'react'
44
import {
55
Button,
66
Checkbox,
7+
Chip,
78
ChipModal,
89
ChipModalBody,
910
ChipModalField,
1011
ChipModalHeader,
11-
cn,
1212
} from '@sim/emcn'
1313
import { ManageWorkspace } from '@sim/emcn/icons'
1414
import { formatDisplayText } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/formatted-text'
@@ -113,25 +113,22 @@ export function GroupedCheckboxList({
113113

114114
return (
115115
<>
116-
<Button
117-
variant='ghost'
116+
<Chip
117+
variant='outline'
118+
fullWidth
119+
leftIcon={ManageWorkspace}
118120
disabled={disabled}
119121
onClick={() => setOpen(true)}
120-
className={cn(
121-
'flex w-full cursor-pointer justify-between rounded-sm border border-[var(--border-1)] bg-[var(--surface-5)] font-sans text-[var(--text-primary)] text-sm focus-visible:ring-0 focus-visible:ring-offset-0 dark:bg-[var(--surface-5)]',
122-
'hover-hover:bg-[var(--surface-active)]'
123-
)}
122+
rightAdornment={
123+
<SelectedCountDisplay
124+
noneSelected={noneSelected}
125+
allSelected={allSelected}
126+
count={selectedValues.length}
127+
/>
128+
}
124129
>
125-
<span className='flex flex-1 items-center gap-2 truncate text-[var(--text-muted)]'>
126-
<ManageWorkspace className='size-4 shrink-0 opacity-50' />
127-
<span className='truncate'>Configure PII Types</span>
128-
</span>
129-
<SelectedCountDisplay
130-
noneSelected={noneSelected}
131-
allSelected={allSelected}
132-
count={selectedValues.length}
133-
/>
134-
</Button>
130+
Configure PII Types
131+
</Chip>
135132
<ChipModal open={open} onOpenChange={setOpen} srTitle='Select PII Types to Detect' size='lg'>
136133
<ChipModalHeader onClose={() => setOpen(false)}>Select PII Types to Detect</ChipModalHeader>
137134
<ChipModalBody onWheel={(e) => e.stopPropagation()}>

0 commit comments

Comments
 (0)