feat(tip): add coffee tipping page
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
"use client";
|
||||
|
||||
import { useSearchParams } from "next/navigation";
|
||||
|
||||
import type { PayChannel } from "@/data/dto/payment";
|
||||
|
||||
import { TipScreen } from "./tip-screen";
|
||||
|
||||
function toPayChannel(value: string | null): PayChannel | null {
|
||||
if (value === "ezpay" || value === "stripe") return value;
|
||||
return null;
|
||||
}
|
||||
|
||||
export function TipPageClient() {
|
||||
const searchParams = useSearchParams();
|
||||
|
||||
return (
|
||||
<TipScreen
|
||||
shouldResumePendingOrder={searchParams.get("paymentReturn") === "1"}
|
||||
initialPayChannel={toPayChannel(searchParams.get("payChannel"))}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user