2
0

📝 Add Savings Estimator template

This commit is contained in:
Baptiste Arnaud
2024-06-20 15:19:51 +02:00
parent 1380e03b82
commit 531a1be003
4 changed files with 604 additions and 4 deletions

View File

@@ -70,8 +70,7 @@ export const ButtonsItemNode = ({ item, indices, isMouseOver }: Props) => {
}
const handleEditableChange = (val: string) => {
if (val.length - itemValue.length && val.endsWith('\n')) return
if (val.length - itemValue.length === 1) return setItemValue(val)
if (itemValue !== '') return setItemValue(val)
const values = convertStrToList(val)
if (values.length === 1) {
setItemValue(values[0])

View File

@@ -32,7 +32,7 @@ import { trpc } from '@/lib/trpc'
import { EventsActions, eventsActions } from './typebotActions/events'
import { useGroupsStore } from '@/features/graph/hooks/useGroupsStore'
const autoSaveTimeout = 10000
const autoSaveTimeout = 15000
type UpdateTypebotPayload = Partial<
Pick<
@@ -225,7 +225,12 @@ export const TypebotProvider = ({
...localTypebot,
...updates,
}
if (dequal(omit(typebot, 'updatedAt'), omit(typebotToSave, 'updatedAt')))
if (
dequal(
JSON.parse(JSON.stringify(omit(typebot, 'updatedAt'))),
JSON.parse(JSON.stringify(omit(typebotToSave, 'updatedAt')))
)
)
return
const newParsedTypebot = typebotV6Schema.parse({ ...typebotToSave })
setLocalTypebot(newParsedTypebot)

View File

@@ -154,5 +154,14 @@ export const useTemplates = (): TemplateProps[] => {
fileName: 'openai-assistant-chat.json',
description: 'A simple conversation with your OpenAI assistant.',
},
{
name: 'Savings Estimator',
emoji: '💰',
fileName: 'savings-estimator.json',
isNew: true,
category: 'marketing',
description:
"This bot works for INGA, a commerce that sells reusable sponges and paper towels. It asks simple question to estimate the user's potential savings if he decides to buy INGA products.",
},
]
}