feat: implement contact form and Chatwoot widget

Add Resend API-based contact form and Chatwoot widget integration.

Co-authored-by: ASOwnerYT <[email protected]>
This commit is contained in:
v0
2026-03-20 00:45:35 +00:00
co-authored by ASOwnerYT
parent 39daf41b93
commit 21d4c5f579
4 changed files with 168 additions and 11 deletions
+42
View File
@@ -0,0 +1,42 @@
'use client'
import { useEffect } from 'react'
export function ChatwootWidget() {
useEffect(() => {
const chatwootToken = process.env.NEXT_PUBLIC_CHATWOOT_ACCOUNT_TOKEN
if (!chatwootToken) {
console.warn('[v0] Chatwoot account token not configured')
return
}
// Load Chatwoot widget script
const script = document.createElement('script')
script.src = 'https://app.chatwoot.com/packs/js/sdk.js'
script.async = true
script.onload = () => {
// Initialize Chatwoot after script loads
if ((window as any).chatwootSDK) {
;(window as any).chatwootSDK.run({
websiteToken: chatwootToken,
baseUrl: 'https://app.chatwoot.com'
})
}
}
script.onerror = () => {
console.error('[v0] Failed to load Chatwoot widget')
}
document.body.appendChild(script)
return () => {
// Cleanup is handled by Chatwoot itself
// Don't remove the script as it manages its own lifecycle
}
}, [])
return null
}