Interface: MachineGridProps
Defined in: components/MachineGrid.tsx:73
Properties
addToCartLabels?
optionaladdToCartLabels?:Record<string,string>
Defined in: components/MachineGrid.tsx:177
afterAddToCart?
optionalafterAddToCart?: (cart,item?) =>void
Defined in: components/MachineGrid.tsx:131
Fired after every successful add-to-cart (adds into an EXISTING cart too, not
just the first create). Forward this to CartContext.saveCart or the cart
icon/sidebar/page won't reflect parts added from the grid — onCartCreated
alone only fires when a brand-new cart is created.
Parameters
cart
Cart
item?
CartMainItem
Returns
void
allowAddToCart?
optionalallowAddToCart?:boolean
Defined in: components/MachineGrid.tsx:132
basePath
basePath:
string
Defined in: components/MachineGrid.tsx:78
Localized machines base path (e.g. /nl/machines) — used to build hrefs.
cartId?
optionalcartId?:string
Defined in: components/MachineGrid.tsx:122
className?
optionalclassName?:string
Defined in: components/MachineGrid.tsx:182
companyId?
optionalcompanyId?:number
Defined in: components/MachineGrid.tsx:114
configuration?
optionalconfiguration?:object
Defined in: components/MachineGrid.tsx:118
imageSearchFiltersGrid?
optionalimageSearchFiltersGrid?:unknown
imageVariantFiltersMedium?
optionalimageVariantFiltersMedium?:unknown
createCart?
optionalcreateCart?:boolean
Defined in: components/MachineGrid.tsx:123
filtersLabels?
optionalfiltersLabels?:Record<string,string>
Defined in: components/MachineGrid.tsx:148
graphqlClient?
optionalgraphqlClient?:GraphQLClient
Defined in: components/MachineGrid.tsx:112
labels?
optionallabels?:Record<string,string>
Defined in: components/MachineGrid.tsx:180
language?
optionallanguage?:string
Defined in: components/MachineGrid.tsx:116
Storefront language (parts).
listing
listing:
MachineListingState
Defined in: components/MachineGrid.tsx:103
machineCardLabels?
optionalmachineCardLabels?:Record<string,string>
Defined in: components/MachineGrid.tsx:165
Labels for the machine side of the grid.
Keys read here: loading, noMachines, machineNotFound,
quantityInMachine and searchParts. The same object is passed to each
MachineCard as its labels, which reads viewMachine — so all six keys
belong in it.
quantityInMachine and searchParts used to be read from toolbarLabels,
which is forwarded verbatim to GridToolbar: a shop that translated its
toolbar dictionary properly still got "Qty in machine" and "Search parts…"
in English, because those keys belong to no toolbar (PWP-995a). They are
still read from toolbarLabels as a fallback so existing hosts keep
working.
machineLanguage?
optionalmachineLanguage?:string
Defined in: components/MachineGrid.tsx:90
Language the machine tree is authored in (usually EN). Defaults to 'EN'.
machineLanguages?
optionalmachineLanguages?:string[]
Defined in: components/MachineGrid.tsx:100
Other languages the tree may be authored in, tried in order when a slug
does not resolve in machineLanguage.
A slug resolves only in its own language, so a half-translated tree lists a
machine by its NL slug and then cannot open it with language: 'EN'. Pass
the shop's locales here; machineLanguage and the storefront language
are always tried first (PWP-993).
onCartCreated?
optionalonCartCreated?: (cart) =>void
Defined in: components/MachineGrid.tsx:124
Parameters
cart
Cart
Returns
void
onListingChange
onListingChange: (
next) =>void
Defined in: components/MachineGrid.tsx:104
Parameters
next
Returns
void
onProductClick?
optionalonProductClick?: (product) =>void
Defined in: components/MachineGrid.tsx:136
Parameters
product
Product
Returns
void
pageHref?
optionalpageHref?: (page) =>string
Defined in: components/MachineGrid.tsx:109
URL for a page of the parts listing. Forwarded to GridPagination, which
renders anchors when it is supplied; the host owns the URL shape.
Parameters
page
number
Returns
string
paginationLabels?
optionalpaginationLabels?:Record<string,string>
Defined in: components/MachineGrid.tsx:147
portalMode?
optionalportalMode?:string
Defined in: components/MachineGrid.tsx:119
priceLabels?
optionalpriceLabels?:Record<string,string>
Defined in: components/MachineGrid.tsx:179
productCardComponent?
optionalproductCardComponent?:ComponentType<ProductCardProps>
Defined in: components/MachineGrid.tsx:144
Custom card for the PARTS list, forwarded to the inner ProductGrid. Without it a product rendered with the host's custom card on a normal listing and with the stock card here, so the same product looked different depending on the page it was reached from (PWP-995c).
productCardLabels?
optionalproductCardLabels?:Record<string,string>
Defined in: components/MachineGrid.tsx:176
Labels for the PARTS list, forwarded verbatim to the inner ProductGrid and the components it embeds.
MachineGrid used to forward none of these and expose no way to reach them, so a translated storefront rendered "In stock", "Add" and "Search parts…" in English in the middle of its own copy. A monolingual shop never noticed (PWP-995a).
rootTitle?
optionalrootTitle?:string
Defined in: components/MachineGrid.tsx:86
Title for the root list. Defaults to 'Machines'.
segments
segments:
string[]
Defined in: components/MachineGrid.tsx:76
Current URL path under the machines root, e.g. ['mixer','frame']. [] = root.
showAvailability?
optionalshowAvailability?:boolean
Defined in: components/MachineGrid.tsx:135
showPrice?
optionalshowPrice?:boolean
Defined in: components/MachineGrid.tsx:133
showStock?
optionalshowStock?:boolean
Defined in: components/MachineGrid.tsx:134
source?
optionalsource?:string
Defined in: components/MachineGrid.tsx:82
External system the installation ids belong to (root mode).
sourceIds?
optionalsourceIds?:string[]
Defined in: components/MachineGrid.tsx:84
Installation ids from MY_INSTALLATIONS (root mode).
stockLabels?
optionalstockLabels?:Record<string,string>
Defined in: components/MachineGrid.tsx:178
taxZone?
optionaltaxZone?:string
Defined in: components/MachineGrid.tsx:117
toolbarLabels?
optionaltoolbarLabels?:Record<string,string>
Defined in: components/MachineGrid.tsx:149
user?
optionaluser?:Contact|Customer|null
Defined in: components/MachineGrid.tsx:113