2
0

fix(typebotLink): current typebot dropdown

This commit is contained in:
Baptiste Arnaud
2022-08-21 10:01:54 +02:00
parent bd41d7fc9b
commit 93161b74b2

View File

@ -9,7 +9,7 @@ import { useTypebots } from 'services/typebots'
import { byId } from 'utils' import { byId } from 'utils'
type Props = { type Props = {
typebotId?: string typebotId?: string | 'current'
currentWorkspaceId: string currentWorkspaceId: string
onSelectTypebotId: (typebotId: string | 'current') => void onSelectTypebotId: (typebotId: string | 'current') => void
} }
@ -43,7 +43,9 @@ export const TypebotsDropdown = ({
return ( return (
<HStack> <HStack>
<SearchableDropdown <SearchableDropdown
selectedItem={currentTypebot?.name} selectedItem={
typebotId === 'current' ? 'Current typebot' : currentTypebot?.name
}
items={['Current typebot', ...(typebots ?? []).map((t) => t.name)]} items={['Current typebot', ...(typebots ?? []).map((t) => t.name)]}
onValueChange={handleTypebotSelect} onValueChange={handleTypebotSelect}
placeholder={'Select a typebot'} placeholder={'Select a typebot'}