Skip to main content

Interface: MachineGridProps

Defined in: components/MachineGrid.tsx:73

Properties​

addToCartLabels?​

optional addToCartLabels?: Record<string, string>

Defined in: components/MachineGrid.tsx:177


afterAddToCart?​

optional afterAddToCart?: (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?​

optional allowAddToCart?: 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?​

optional cartId?: string

Defined in: components/MachineGrid.tsx:122


className?​

optional className?: string

Defined in: components/MachineGrid.tsx:182


companyId?​

optional companyId?: number

Defined in: components/MachineGrid.tsx:114


configuration?​

optional configuration?: object

Defined in: components/MachineGrid.tsx:118

imageSearchFiltersGrid?​

optional imageSearchFiltersGrid?: unknown

imageVariantFiltersMedium?​

optional imageVariantFiltersMedium?: unknown


createCart?​

optional createCart?: boolean

Defined in: components/MachineGrid.tsx:123


filtersLabels?​

optional filtersLabels?: Record<string, string>

Defined in: components/MachineGrid.tsx:148


graphqlClient?​

optional graphqlClient?: GraphQLClient

Defined in: components/MachineGrid.tsx:112


labels?​

optional labels?: Record<string, string>

Defined in: components/MachineGrid.tsx:180


language?​

optional language?: string

Defined in: components/MachineGrid.tsx:116

Storefront language (parts).


listing​

listing: MachineListingState

Defined in: components/MachineGrid.tsx:103


machineCardLabels?​

optional machineCardLabels?: 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?​

optional machineLanguage?: string

Defined in: components/MachineGrid.tsx:90

Language the machine tree is authored in (usually EN). Defaults to 'EN'.


machineLanguages?​

optional machineLanguages?: 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?​

optional onCartCreated?: (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​

MachineListingState

Returns​

void


onProductClick?​

optional onProductClick?: (product) => void

Defined in: components/MachineGrid.tsx:136

Parameters​

product​

Product

Returns​

void


pageHref?​

optional pageHref?: (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?​

optional paginationLabels?: Record<string, string>

Defined in: components/MachineGrid.tsx:147


portalMode?​

optional portalMode?: string

Defined in: components/MachineGrid.tsx:119


priceLabels?​

optional priceLabels?: Record<string, string>

Defined in: components/MachineGrid.tsx:179


productCardComponent?​

optional productCardComponent?: 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?​

optional productCardLabels?: 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?​

optional rootTitle?: 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?​

optional showAvailability?: boolean

Defined in: components/MachineGrid.tsx:135


showPrice?​

optional showPrice?: boolean

Defined in: components/MachineGrid.tsx:133


showStock?​

optional showStock?: boolean

Defined in: components/MachineGrid.tsx:134


source?​

optional source?: string

Defined in: components/MachineGrid.tsx:82

External system the installation ids belong to (root mode).


sourceIds?​

optional sourceIds?: string[]

Defined in: components/MachineGrid.tsx:84

Installation ids from MY_INSTALLATIONS (root mode).


stockLabels?​

optional stockLabels?: Record<string, string>

Defined in: components/MachineGrid.tsx:178


taxZone?​

optional taxZone?: string

Defined in: components/MachineGrid.tsx:117


toolbarLabels?​

optional toolbarLabels?: Record<string, string>

Defined in: components/MachineGrid.tsx:149


user?​

optional user?: Contact | Customer | null

Defined in: components/MachineGrid.tsx:113