@@ -4,6 +4,7 @@ import { useMemo, useState } from 'react'
44import { ArrowLeft , ArrowLeftRight , Info , Plus , Search } from 'lucide-react'
55import { useParams } from 'next/navigation'
66import {
7+ ArrowRight ,
78 Button ,
89 ButtonGroup ,
910 ButtonGroupItem ,
@@ -22,6 +23,7 @@ import {
2223 Tooltip ,
2324} from '@/components/emcn'
2425import { getSubscriptionAccessState } from '@/lib/billing/client'
26+ import { cn } from '@/lib/core/utils/cn'
2527import { handleKeyboardActivation } from '@/lib/core/utils/keyboard'
2628import { consumeOAuthReturnContext } from '@/lib/credentials/client-state'
2729import {
@@ -36,6 +38,7 @@ import { MaxBadge } from '@/app/workspace/[workspaceId]/knowledge/[id]/component
3638import type { ConfigFieldValue } from '@/app/workspace/[workspaceId]/knowledge/[id]/hooks/use-connector-config-fields'
3739import { useConnectorConfigFields } from '@/app/workspace/[workspaceId]/knowledge/[id]/hooks/use-connector-config-fields'
3840import { isBillingEnabled } from '@/app/workspace/[workspaceId]/settings/navigation'
41+ import { getBlock } from '@/blocks'
3942import { CONNECTOR_REGISTRY } from '@/connectors/registry'
4043import type { ConnectorConfig , ConnectorConfigField } from '@/connectors/types'
4144import { useCreateConnector } from '@/hooks/queries/kb/connectors'
@@ -250,23 +253,21 @@ export function AddConnectorModal({
250253 < ModalBody className = { step === 'select-type' ? 'pt-2 pb-3' : 'pb-3' } >
251254 { step === 'select-type' ? (
252255 < div className = 'flex min-h-0 flex-col gap-2.5' >
253- < div className = 'flex h-8 items-center gap-2 rounded-md border border-[var(--border)] bg-[var(--surface-3)] px-2 transition-colors duration-100 hover-hover:border-[var(--border-1)] hover-hover:bg-[var(--surface-4)]' >
254- < Search
255- className = 'size-[14px] flex-shrink-0 text-[var(--text-icon)]'
256- strokeWidth = { 2 }
257- />
256+ < div className = 'flex h-[30px] items-center gap-2 rounded-lg border border-[var(--border-1)] bg-[var(--surface-5)] px-2 dark:bg-[var(--surface-4)]' >
257+ < Search className = 'size-[14px] flex-shrink-0 text-[var(--text-muted)]' />
258258 < Input
259259 placeholder = 'Search sources...'
260260 value = { searchTerm }
261261 onChange = { ( e ) => setSearchTerm ( e . target . value ) }
262- className = 'h-auto flex-1 border-0 bg-transparent p-0 font-medium text-small leading -none placeholder:text-[var(--text-muted)] focus-visible:ring-0 focus-visible:ring-offset-0'
262+ className = 'h-full w-full border-0 bg-transparent p-0 text-[var(--text-body)] text-sm outline -none placeholder:text-[var(--text-muted)] focus-visible:ring-0 focus-visible:ring-offset-0'
263263 />
264264 </ div >
265265 < div className = 'max-h-[390px] min-h-0 overflow-y-auto [scrollbar-gutter:stable]' >
266266 < div className = 'flex flex-col gap-0.5 pr-1' >
267267 { filteredEntries . map ( ( [ type , config ] ) => (
268268 < ConnectorTypeCard
269269 key = { type }
270+ type = { type }
270271 config = { config }
271272 onClick = { ( ) => handleSelectType ( type ) }
272273 />
@@ -543,27 +544,39 @@ export function AddConnectorModal({
543544}
544545
545546interface ConnectorTypeCardProps {
547+ type : string
546548 config : ConnectorConfig
547549 onClick : ( ) => void
548550}
549551
550- function ConnectorTypeCard ( { config, onClick } : ConnectorTypeCardProps ) {
552+ function ConnectorTypeCard ( { type , config, onClick } : ConnectorTypeCardProps ) {
551553 const Icon = config . icon
554+ const brandBg = getBlock ( type ) ?. bgColor ?? null
552555
553556 return (
554- < Button
557+ < button
555558 type = 'button'
556- variant = 'ghost'
557- className = 'group flex min-h-10 w-full justify-start gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover-hover:bg-[var(--surface-active)]'
559+ className = 'flex w-full items-center gap-2.5 rounded-lg p-2 text-left transition-colors hover-hover:bg-[var(--surface-active)]'
558560 onClick = { onClick }
559561 >
560- < Icon className = 'size-[18px] flex-shrink-0 text-[var(--text-icon)]' />
561- < div className = 'flex min-w-0 flex-1 flex-col gap-[1px]' >
562- < span className = 'truncate font-medium text-[var(--text-body)] text-small' >
563- { config . name }
564- </ span >
565- < span className = 'truncate text-[var(--text-muted)] text-caption' > { config . description } </ span >
562+ < div className = 'size-9 flex-shrink-0' >
563+ < div
564+ className = { cn (
565+ 'flex size-full items-center justify-center rounded-xl border' ,
566+ brandBg
567+ ? 'border-[var(--border-1)]'
568+ : 'border-[var(--border-muted)] bg-[var(--surface-4)]'
569+ ) }
570+ style = { brandBg ? { background : brandBg } : undefined }
571+ >
572+ < Icon className = { cn ( 'size-5' , brandBg ? 'text-white' : 'text-[var(--text-icon)]' ) } />
573+ </ div >
574+ </ div >
575+ < div className = 'flex min-w-0 flex-1 flex-col' >
576+ < span className = 'truncate text-[14px] text-[var(--text-body)]' > { config . name } </ span >
577+ < span className = 'truncate text-[12px] text-[var(--text-muted)]' > { config . description } </ span >
566578 </ div >
567- </ Button >
579+ < ArrowRight className = 'size-4 flex-shrink-0 text-[var(--text-icon)]' />
580+ </ button >
568581 )
569582}
0 commit comments