Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,7 @@ function ProgramFraudSettingsSheetContent({
<div className="flex h-16 items-center justify-between px-6 py-4">
<Sheet.Title className="flex items-center gap-2 text-lg font-semibold">
Fraud settings
<InfoTooltip
content={
"Learn more about our fraud and risk flags, including how to configure them. [Learn more.](https://dub.co/help/article/fraud-and-risk-flags)"
}
/>
<InfoTooltip content="Learn more about how to [customize your program's fraud settings](https://dub.co/help/article/fraud-detection)." />
</Sheet.Title>
<Sheet.Close asChild>
<Button
Expand Down
4 changes: 3 additions & 1 deletion apps/web/lib/ai/upsert-docs-embedding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ async function cleanMdx(

content = content.replace(
/<PayoutSupportedCountries\s*\/>/g,
PAYOUT_SUPPORTED_COUNTRIES.map((c) => `- ${c.name} (${c.code})`).join("\n"),
PAYOUT_SUPPORTED_COUNTRIES.map(
(c) => `- ${c.name} [${c.code}] (${c.methods.join(", ")})`,
).join("\n"),
);

content = content.replace(/<[A-Z][A-Za-z]*\s*\/>/g, "");
Expand Down
7 changes: 6 additions & 1 deletion apps/web/lib/constants/payouts-supported-countries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
PAYPAL_SUPPORTED_COUNTRIES,
STABLECOIN_SUPPORTED_COUNTRIES,
} from "@dub/utils";
import { getPayoutMethodsForCountry } from "../partners/get-payout-methods-for-country";

export const PAYOUT_SUPPORTED_COUNTRIES = [
...new Set([
Expand All @@ -13,4 +14,8 @@ export const PAYOUT_SUPPORTED_COUNTRIES = [
]),
]
.sort((a, b) => COUNTRIES[a].localeCompare(COUNTRIES[b]))
.map((code) => ({ code, name: COUNTRIES[code] }));
.map((code) => ({
code,
name: COUNTRIES[code],
methods: getPayoutMethodsForCountry({ country: code }),
}));
26 changes: 21 additions & 5 deletions apps/web/ui/partners/partner-row-item.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import useProgram from "@/lib/swr/use-program";
import { PartnerPayoutMethod } from "@dub/prisma/client";
import { CircleArrowRight, DynamicTooltipWrapper, GreekTemple } from "@dub/ui";
import { cn, formatDateTimeSmart } from "@dub/utils";
import { cn, timeAgo } from "@dub/utils";
import { OG_AVATAR_URL } from "@dub/utils/src/constants";
import { CircleMinus } from "lucide-react";
import Link from "next/link";
import { useParams } from "next/navigation";
import { PartnerFraudIndicator } from "./fraud-risks/partner-fraud-indicator";
import { getPayoutMethodLabel } from "./payouts/payout-method-config";
import {
getPayoutMethodIconConfig,
getPayoutMethodLabel,
} from "./payouts/payout-method-config";

interface PartnerRowItemProps {
showPermalink?: boolean;
Expand Down Expand Up @@ -118,6 +121,11 @@ function PartnerPayoutStatusTooltip({
partner.payoutsEnabledAt &&
partner.defaultPayoutMethod;

const { Icon: MethodIcon, wrapperClass: methodWrapperClass } =
hasPayoutDetails
? getPayoutMethodIconConfig(partner.defaultPayoutMethod!)
: { Icon: GreekTemple, wrapperClass: "" };

return (
<div className="max-w-xs">
<div className="grid gap-2 p-2.5">
Expand All @@ -137,10 +145,18 @@ function PartnerPayoutStatusTooltip({
</div>
</div>
{hasPayoutDetails && (
<div className="border-t border-neutral-100 p-2.5 text-xs text-neutral-600">
<div className="flex items-center gap-1.5 border-t border-neutral-100 p-2.5 text-xs text-neutral-600">
<div
className={cn(
"flex size-5 shrink-0 items-center justify-center rounded-md border",
methodWrapperClass,
)}
>
<MethodIcon className="size-3" />
</div>
<span>
Connected {getPayoutMethodLabel(partner.defaultPayoutMethod!)}{" "}
{formatDateTimeSmart(partner.payoutsEnabledAt!)}
{getPayoutMethodLabel(partner.defaultPayoutMethod!)} · Connected{" "}
{timeAgo(partner.payoutsEnabledAt!, { withAgo: true })}
</span>
</div>
)}
Expand Down
Loading