diff --git a/apps/business/src/components/ListFiltersPanel.module.css b/apps/business/src/components/ListFiltersPanel.module.css index 4cd7589..220b7a2 100644 --- a/apps/business/src/components/ListFiltersPanel.module.css +++ b/apps/business/src/components/ListFiltersPanel.module.css @@ -21,6 +21,9 @@ grid-template-columns: repeat(12, 1fr); gap: 8px 12px; align-items: center; + margin: 0; + padding: 0; + border: none; } .filtersInputs { diff --git a/apps/business/src/components/ProductFieldAiPromptModal.tsx b/apps/business/src/components/ProductFieldAiPromptModal.tsx new file mode 100644 index 0000000..b91ad6c --- /dev/null +++ b/apps/business/src/components/ProductFieldAiPromptModal.tsx @@ -0,0 +1,273 @@ +import { useEffect, useState } from 'react' +import { createPortal } from 'react-dom' +import { Sparkles, X } from 'lucide-react' +import { useLocale } from '@meshkee/dashboard-ui' +import { useT } from '../i18n/useT' +import type { ProductAiFillField } from '../services/productAiService' +import modalStyles from './CategoryModal.module.css' +import aiStyles from '../styles/ai.module.css' +import styles from './CategoryAiPromptModal.module.css' + +export function buildProductSummaryAiPrompt(ctx: { + nameFa: string + nameEn: string + categoryName: string + locale: 'fa' | 'en' +}) { + const nameFa = ctx.nameFa || '—' + const nameEn = ctx.nameEn || '—' + const category = ctx.categoryName || '—' + + if (ctx.locale === 'fa') { + return `یک خلاصه کوتاه و فنی برای کارت محصول بنویس (۱ تا ۳ جمله). + +نام محصول (فارسی): ${nameFa} +نام محصول (انگلیسی): ${nameEn} +دستهبندی: ${category} + +الزامات: +- اول بگو این محصول چیست (نوع / ماهیت کالا). +- بعد توضیح بده چرا از نظر ترکیب، کاربرد یا ویژگی فنی خوب است. +- لحن اطلاعاتی و تخصصی باشد، نه تبلیغاتی. +- از عبارات فروش مثل «انتخاب عالی»، «تجربه فوقالعاده»، «با قیمت مناسب بخرید»، «از ما خریداری کنید» استفاده نکن. +- مشخصات یا ادعاهایی که مطمئن نیستی اختراع نکن. +- خلاصه را به فارسی بنویس.` + } + + return `Write a short, technical product listing summary (1–3 sentences). + +Product name (FA): ${nameFa} +Product name (EN): ${nameEn} +Category: ${category} + +Requirements: +- First say what the product is (type / nature of the item). +- Then explain why it is good in terms of composition, use, or technical traits. +- Keep an informative, specialist tone — not advertising. +- Avoid sales phrases like "excellent choice", "amazing experience", "buy now", "great price from us". +- Do not invent specs or claims you are unsure about. +- Write the summary in Persian (Farsi).` +} + +export function buildProductDescriptionAiPrompt(ctx: { + nameFa: string + nameEn: string + categoryName: string + locale: 'fa' | 'en' +}) { + const nameFa = ctx.nameFa || '—' + const nameEn = ctx.nameEn || '—' + const category = ctx.categoryName || '—' + + if (ctx.locale === 'fa') { + return `یک توضیحات فنی محصول به صورت HTML بنویس. + +نام محصول (فارسی): ${nameFa} +نام محصول (انگلیسی): ${nameEn} +دستهبندی: ${category} + +ساختار پیشنهادی: +1) این محصول چیست؟ +2) ترکیب / مواد / ویژگیهای فنی مهم +3) کاربرد و اینکه چرا برای آن کاربرد مناسب است +4) در صورت نیاز، فهرست نقطهای نکات کلیدی + +الزامات: +- لحن اطلاعاتی و تخصصی؛ نه شعار تبلیغاتی. +- از دعوت به خرید، تخفیف، «بهترین انتخاب»، و جملات بازاریابی مبهم پرهیز کن. +- مشخصات ساختگی ننویس؛ اگر جزئیات دقیق نداری، روی تعریف محصول و کاربردهای معمول تمرکز کن. +- ۲ تا ۴ پاراگراف کوتاه به فارسی. +- فقط HTML با تگهای
،
,
{t('products.form.aiFillSubtitle')}
+