Skip to content

Commit 983a274

Browse files
committed
feat: custom placeholder
this pr is for adding custom placeholders
1 parent 921542f commit 983a274

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Components/FloatingWhatsapp.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ interface FloatingWhatsAppProps {
1111
darkMode?: boolean
1212
styles?: React.CSSProperties
1313
className?: string
14+
placeholder?: string
1415
}
1516

1617
const time = new Date().toTimeString().split(`:`).slice(0, 2).join(`:`)
@@ -25,7 +26,8 @@ function FloatingWhatsApp({
2526
chatMessage = 'Hello there! 🤝 \nHow can we help?',
2627
darkMode = false,
2728
styles = {},
28-
className = ''
29+
className = '',
30+
placeholder
2931
}: FloatingWhatsAppProps): JSX.Element {
3032
const [isOpen, setOpen] = useState(false)
3133
const [message, setMessage] = useState('')
@@ -70,7 +72,7 @@ function FloatingWhatsApp({
7072
<form onSubmit={handleSubmit}>
7173
<input
7274
className={`${css.input} ${isArabic(message) ? css.arabic : ''}`}
73-
placeholder='Type a message..'
75+
placeholder={placeholder ?? 'Type a message..'}
7476
onChange={handleChange}
7577
value={message}
7678
dir='auto'

0 commit comments

Comments
 (0)