import { AllProducts, ProductCategory } from 'types/graphql-nodes'; import { MerchantProduct } from 'types/product'; export interface ShopProps { pathContext: { categorySlug: string; }; data: { products: AllProducts; category: ProductCategory; }; } export interface SortOptionType { slug: string; title: string; valueKey: number; } export interface ShopState { sort: string; selectedCategory: string; } export interface ProductItemType { node: MerchantProduct; } export type SortType = | 'nameASC' | 'nameDESC' | 'priceASC' | 'priceDESC'; export type SortByTypes = { [sortType in SortType]: (a: ProductItemType, b: ProductItemType) => number; };