Skip to content

Commit fc006ee

Browse files
committed
updated styling
1 parent 4872e75 commit fc006ee

File tree

1 file changed

+15
-36
lines changed

1 file changed

+15
-36
lines changed

apps/sim/app/workspace/[workspaceId]/knowledge/components/create-base-modal/create-base-modal.tsx

Lines changed: 15 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,14 @@
33
import { memo, useEffect, useRef, useState } from 'react'
44
import { zodResolver } from '@hookform/resolvers/zod'
55
import { createLogger } from '@sim/logger'
6-
import { ChevronDown, Loader2, RotateCcw, X } from 'lucide-react'
6+
import { Loader2, RotateCcw, X } from 'lucide-react'
77
import { useParams } from 'next/navigation'
88
import { useForm } from 'react-hook-form'
99
import { z } from 'zod'
1010
import {
1111
Button,
12-
DropdownMenu,
13-
DropdownMenuContent,
14-
DropdownMenuRadioGroup,
15-
DropdownMenuRadioItem,
16-
DropdownMenuTrigger,
12+
Combobox,
13+
type ComboboxOption,
1714
Input,
1815
Label,
1916
Modal,
@@ -50,6 +47,11 @@ const STRATEGY_OPTIONS = [
5047
{ value: 'regex', label: 'Regex (custom pattern)' },
5148
] as const
5249

50+
const STRATEGY_COMBOBOX_OPTIONS: ComboboxOption[] = STRATEGY_OPTIONS.map((o) => ({
51+
label: o.label,
52+
value: o.value,
53+
}))
54+
5355
const FormSchema = z
5456
.object({
5557
name: z
@@ -467,36 +469,13 @@ export const CreateBaseModal = memo(function CreateBaseModal({
467469

468470
<div className='flex flex-col gap-2'>
469471
<Label>Chunking Strategy</Label>
470-
<DropdownMenu>
471-
<DropdownMenuTrigger asChild>
472-
<Button
473-
type='button'
474-
variant='default'
475-
className='!bg-[var(--surface-1)] w-full justify-between border border-[var(--border-1)] font-normal'
476-
>
477-
{STRATEGY_OPTIONS.find((o) => o.value === strategyValue)?.label ??
478-
'Auto (detect from content)'}
479-
<ChevronDown className='h-[12px] w-[12px] text-[var(--text-icon)]' />
480-
</Button>
481-
</DropdownMenuTrigger>
482-
<DropdownMenuContent
483-
align='start'
484-
className='w-[var(--radix-dropdown-menu-trigger-width)]'
485-
>
486-
<DropdownMenuRadioGroup
487-
value={strategyValue}
488-
onValueChange={(value) =>
489-
setValue('strategy', value as FormValues['strategy'])
490-
}
491-
>
492-
{STRATEGY_OPTIONS.map((option) => (
493-
<DropdownMenuRadioItem key={option.value} value={option.value}>
494-
{option.label}
495-
</DropdownMenuRadioItem>
496-
))}
497-
</DropdownMenuRadioGroup>
498-
</DropdownMenuContent>
499-
</DropdownMenu>
472+
<Combobox
473+
options={STRATEGY_COMBOBOX_OPTIONS}
474+
value={strategyValue}
475+
onChange={(value) => setValue('strategy', value as FormValues['strategy'])}
476+
dropdownWidth='trigger'
477+
align='start'
478+
/>
500479
<p className='text-[var(--text-muted)] text-xs'>
501480
Auto detects the best strategy based on file content type.
502481
</p>

0 commit comments

Comments
 (0)