💄 (textInput) Show send icon if send label is empty
This commit is contained in:
@@ -3,6 +3,7 @@ import { splitProps } from 'solid-js'
|
||||
import { JSX } from 'solid-js/jsx-runtime'
|
||||
import { SendIcon } from './icons'
|
||||
import { Button } from './Button'
|
||||
import { isEmpty } from '@typebot.io/lib'
|
||||
|
||||
type SendButtonProps = {
|
||||
isDisabled?: boolean
|
||||
@@ -14,7 +15,8 @@ export const SendButton = (props: SendButtonProps) => {
|
||||
const [local, others] = splitProps(props, ['disableIcon'])
|
||||
return (
|
||||
<Button type="submit" {...others}>
|
||||
{isMobile() && !local.disableIcon ? (
|
||||
{(isMobile() && !local.disableIcon) ||
|
||||
(typeof props.children === 'string' && isEmpty(props.children)) ? (
|
||||
<SendIcon
|
||||
class={'send-icon flex ' + (local.disableIcon ? 'hidden' : '')}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user