The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
import { usePlans } from '@/settings/billing/hooks/usePlans';
import {
type BillingPriceLicensed,
type BillingPriceMetered,
} from '~/generated-metadata/graphql';
export const useAllBillingPrices = () => {
const { listPlans } = usePlans();
const allBillingPrices = listPlans()
.map(({ baseProducts, resourceCreditProducts, meteredProducts }) => {
return [
...baseProducts,
...resourceCreditProducts,
...meteredProducts,
].map(({ prices }) => prices);
})
.flat(2) as Array<BillingPriceLicensed | BillingPriceMetered>;
return { allBillingPrices };
};