enable chat
deploy to danak / build_and_deploy (push) Has been cancelled

This commit is contained in:
2026-07-26 14:13:12 +03:30
parent b9fc6ab247
commit f30ee4f6e3
2 changed files with 14 additions and 1 deletions
+12 -1
View File
@@ -4,6 +4,7 @@ import Input from '@/components/Input'
import Textarea from '@/components/Textarea' import Textarea from '@/components/Textarea'
import UploadBox from '@/components/UploadBox' import UploadBox from '@/components/UploadBox'
import DefaulModal from '@/components/DefaulModal' import DefaulModal from '@/components/DefaulModal'
import SwitchComponent from '@/components/Switch'
import LocationPicker from './components/LocationPicker' import LocationPicker from './components/LocationPicker'
import LocationInput from './components/LocationInput' import LocationInput from './components/LocationInput'
import { TickCircle } from 'iconsax-react' import { TickCircle } from 'iconsax-react'
@@ -58,6 +59,7 @@ const GeneralSettings: FC = () => {
logo: '', logo: '',
establishedYear: null, establishedYear: null,
serviceArea: undefined, serviceArea: undefined,
enableAiChat: false,
}, },
validationSchema, validationSchema,
onSubmit: (values) => { onSubmit: (values) => {
@@ -117,6 +119,7 @@ const GeneralSettings: FC = () => {
logo: restaurantData.logo || '', logo: restaurantData.logo || '',
establishedYear: restaurantData.establishedYear ?? null, establishedYear: restaurantData.establishedYear ?? null,
serviceArea: restaurantData.serviceArea || undefined, serviceArea: restaurantData.serviceArea || undefined,
enableAiChat: restaurantData.enableAiChat ?? false,
}) })
} }
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -243,7 +246,15 @@ const GeneralSettings: FC = () => {
onPolygonSelect={(polygon) => formik.setFieldValue('serviceArea', polygon)} onPolygonSelect={(polygon) => formik.setFieldValue('serviceArea', polygon)}
/> />
</div> </div>
{/* </div> */}
<div className='mt-8'>
<div className='text-sm mb-3'>چت هوش مصنوعی</div>
<SwitchComponent
active={formik.values.enableAiChat ?? false}
onChange={(value) => formik.setFieldValue('enableAiChat', value)}
label={formik.values.enableAiChat ? 'فعال' : 'غیرفعال'}
/>
</div>
<div className='mt-8 flex justify-end'> <div className='mt-8 flex justify-end'>
<Button <Button
+2
View File
@@ -19,6 +19,7 @@ export type UpdateRestaurantType = {
description?: string; description?: string;
establishedYear?: number | null; establishedYear?: number | null;
serviceArea?: GeoJSONPolygon; serviceArea?: GeoJSONPolygon;
enableAiChat?: boolean;
score?: { score?: {
purchaseAmount: string; purchaseAmount: string;
purchaseScore: string; purchaseScore: string;
@@ -50,6 +51,7 @@ export type Restaurant = {
longitude: number | null; longitude: number | null;
serviceArea: GeoJSONPolygon; serviceArea: GeoJSONPolygon;
isActive: boolean; isActive: boolean;
enableAiChat: boolean;
establishedYear: number | null; establishedYear: number | null;
phoneNumber: string | null; phoneNumber: string | null;
phone?: string; phone?: string;