File size: 526 Bytes
1e92f2d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | import { useQuery } from '@tanstack/react-query';
import wpcom from 'calypso/lib/wp';
export type PlansComparisonMetaData = {
currency: string;
bottom_theme_price: number;
bottom_theme_price_display: string;
};
export default function usePlansComparisonMeta( currency: string ) {
return useQuery< unknown, unknown, PlansComparisonMetaData >( {
queryKey: [ 'plans-comparison-meta', currency ],
queryFn: () =>
wpcom.req.get(
{
path: '/plans-comparison-meta',
},
{ apiVersion: '1.2' }
),
} );
}
|