coomet length max 300

This commit is contained in:
Samandar Turgunboyev
2026-03-11 19:31:28 +05:00
parent 1a2d3eef6c
commit 9ec9ea586f
3 changed files with 9 additions and 1 deletions

View File

@@ -3,6 +3,6 @@ import { z } from 'zod';
export const orderForm = z.object({ export const orderForm = z.object({
long: z.string().min(1, { message: 'Majburiy maydon' }), long: z.string().min(1, { message: 'Majburiy maydon' }),
lat: z.string().min(1, { message: 'Majburiy maydon' }), lat: z.string().min(1, { message: 'Majburiy maydon' }),
comment: z.string().min(1, { message: 'Majburiy maydon' }), comment: z.string().max(300, 'Izoh 300 ta belgidan oshmasligi kerak'),
city: z.string().optional(), city: z.string().optional(),
}); });

View File

@@ -376,10 +376,14 @@ const OrderPage = () => {
<FormControl> <FormControl>
<Textarea <Textarea
{...field} {...field}
maxLength={300}
className="w-full min-h-42 max-h-64 border border-gray-300 rounded-lg px-4 py-3 focus:outline-none focus:border-blue-500" className="w-full min-h-42 max-h-64 border border-gray-300 rounded-lg px-4 py-3 focus:outline-none focus:border-blue-500"
placeholder={t('Izoh')} placeholder={t('Izoh')}
/> />
</FormControl> </FormControl>
<div className="text-right text-xs text-gray-500">
{field.value?.length || 0}/300
</div>
<FormMessage /> <FormMessage />
</FormItem> </FormItem>
)} )}

View File

@@ -442,10 +442,14 @@ const RefreshOrder = () => {
<FormControl> <FormControl>
<Textarea <Textarea
{...field} {...field}
maxLength={300}
className="w-full min-h-42 max-h-64 border border-gray-300 rounded-lg px-4 py-3 focus:outline-none focus:border-blue-500" className="w-full min-h-42 max-h-64 border border-gray-300 rounded-lg px-4 py-3 focus:outline-none focus:border-blue-500"
placeholder={t('Izoh')} placeholder={t('Izoh')}
/> />
</FormControl> </FormControl>
<div className="text-right text-xs text-gray-500">
{field.value?.length || 0}/300
</div>
<FormMessage /> <FormMessage />
</FormItem> </FormItem>
)} )}