mirror of
https://github.com/andwati/cymelle.git
synced 2026-10-24 02:42:15 +00:00
15 lines
368 B
TypeScript
15 lines
368 B
TypeScript
import { useMutation } from "@tanstack/react-query";
|
|
import { calculateFare } from "#/api/fare";
|
|
|
|
type FareCalculationInput = {
|
|
distanceKm: number;
|
|
surgeMultiplier?: number;
|
|
};
|
|
|
|
export function useFareCalculation() {
|
|
return useMutation({
|
|
mutationFn: ({ distanceKm, surgeMultiplier }: FareCalculationInput) =>
|
|
calculateFare(distanceKm, surgeMultiplier),
|
|
});
|
|
}
|