Show other-pages stats and store-specials AI matching.
Add the Statistics pages row for static_page views, wire specials AI match UI, and tidy Businesses page styles. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
9ce93b0b48
commit
652f4d07b6
@@ -46,6 +46,7 @@ const STAT_ROWS: {
|
||||
}[] = [
|
||||
{ id: 'all', titleKey: 'statistics.row.all' },
|
||||
{ id: 'home', titleKey: 'statistics.row.home' },
|
||||
{ id: 'pages', titleKey: 'statistics.row.pages' },
|
||||
{
|
||||
id: 'products',
|
||||
titleKey: 'statistics.row.products',
|
||||
|
||||
@@ -8,6 +8,7 @@ import { EditStoreItemsModal } from '../components/EditStoreItemsModal'
|
||||
import { PickStoreSpecialItemsModal } from '../components/PickStoreSpecialItemsModal'
|
||||
import { PickStoreVariantModal } from '../components/PickStoreVariantModal'
|
||||
import { ShoppingCartModal } from '../components/ShoppingCartModal'
|
||||
import { SpecialItemsAiModal } from '../components/SpecialItemsAiModal'
|
||||
import { StoreItemDiscountModal } from '../components/StoreItemDiscountModal'
|
||||
import { StoreItemFestivalModal } from '../components/StoreItemFestivalModal'
|
||||
import { StoreSpecialCarousel } from '../components/StoreSpecialCarousel'
|
||||
@@ -59,6 +60,7 @@ export function StoreSpecialsPage() {
|
||||
const [editSpecialTarget, setEditSpecialTarget] = useState<StoreSpecial | null>(null)
|
||||
const [deleteSpecialTarget, setDeleteSpecialTarget] = useState<StoreSpecial | null>(null)
|
||||
const [pickItemsTarget, setPickItemsTarget] = useState<StoreSpecial | null>(null)
|
||||
const [aiTarget, setAiTarget] = useState<StoreSpecial | null>(null)
|
||||
|
||||
const [editListingTarget, setEditListingTarget] = useState<StoreProductListing | null>(null)
|
||||
const [discountTarget, setDiscountTarget] = useState<StoreProductListing | null>(null)
|
||||
@@ -383,6 +385,7 @@ export function StoreSpecialsPage() {
|
||||
onAddItems={setPickItemsTarget}
|
||||
onEditSpecial={setEditSpecialTarget}
|
||||
onDeleteSpecial={setDeleteSpecialTarget}
|
||||
onAiAssist={setAiTarget}
|
||||
onOpenListing={setEditListingTarget}
|
||||
onEditListing={setEditListingTarget}
|
||||
onDiscountListing={setDiscountTarget}
|
||||
@@ -459,6 +462,35 @@ export function StoreSpecialsPage() {
|
||||
isSubmitting={isSaving}
|
||||
/>
|
||||
|
||||
<SpecialItemsAiModal
|
||||
open={!!aiTarget}
|
||||
special={aiTarget}
|
||||
source={specialSource}
|
||||
onClose={() => setAiTarget(null)}
|
||||
onApplied={({ special, added, priced, cleared }) => {
|
||||
replaceSpecial(special)
|
||||
setAiTarget(null)
|
||||
if (cleared && added === 0) {
|
||||
showToast(t('website.specialItems.ai.toastCleared'), 'success')
|
||||
return
|
||||
}
|
||||
if (priced > 0) {
|
||||
showToast(
|
||||
t('website.specialItems.ai.toastAppliedWithPrice', {
|
||||
count: added,
|
||||
priced,
|
||||
}),
|
||||
'success',
|
||||
)
|
||||
return
|
||||
}
|
||||
showToast(
|
||||
t('website.specialItems.ai.toastApplied', { count: added }),
|
||||
'success',
|
||||
)
|
||||
}}
|
||||
/>
|
||||
|
||||
<EditStoreItemsModal
|
||||
open={!!editListingTarget}
|
||||
productTitle={editListingTarget?.productTitle ?? ''}
|
||||
|
||||
Reference in New Issue
Block a user