2
0

💄 (textInput) Show send icon if send label is empty

This commit is contained in:
Baptiste Arnaud
2023-08-07 14:37:11 +02:00
parent 4d3f67c752
commit ec0a5be793

View File

@@ -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' : '')}
/>