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 @@ -20,13 +20,7 @@ import {
useTable,
} from "@dub/ui";
import { User } from "@dub/ui/icons";
import {
COUNTRIES,
currencyFormatter,
formatDate,
getApexDomain,
getPrettyUrl,
} from "@dub/utils";
import { COUNTRIES, formatDate, getApexDomain, getPrettyUrl } from "@dub/utils";
import { useParams, useRouter } from "next/navigation";
import { useMemo } from "react";
import { usePartnerCustomerFilters } from "./use-partner-customer-filters";
Expand Down Expand Up @@ -64,7 +58,6 @@ export function ProgramCustomersPageClient() {
"customer",
"country",
"link",
"saleAmount",
"createdAt",
"firstSaleAt",
"subscriptionCanceledAt",
Expand All @@ -73,7 +66,6 @@ export function ProgramCustomersPageClient() {
"customer",
"country",
"link",
"saleAmount",
"createdAt",
"firstSaleAt",
"subscriptionCanceledAt",
Expand Down Expand Up @@ -149,25 +141,6 @@ export function ProgramCustomersPageClient() {
),
size: 250,
},
{
id: "saleAmount",
header: "LTV",
meta: {
headerTooltip:
"The total amount of revenue the customer has generated over time (lifetime value).",
},
accessorKey: "activity.saleAmount",
cell: ({ getValue }) => (
<div className="flex items-center gap-2">
<span>
{currencyFormatter(getValue() ?? 0, {
trailingZeroDisplay: "stripIfInteger",
})}
</span>
<span className="text-neutral-400">USD</span>
</div>
),
},
{
id: "createdAt",
header: "Created",
Expand Down Expand Up @@ -270,7 +243,7 @@ export function ProgramCustomersPageClient() {
onPaginationChange: setPagination,
columnVisibility,
onColumnVisibilityChange: setColumnVisibility,
sortableColumns: ["saleAmount", "createdAt"],
sortableColumns: ["createdAt", "firstSaleAt", "subscriptionCanceledAt"],
sortBy,
sortOrder,
onSortChange: ({ sortBy, sortOrder }) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function PartnerStats({
? "-"
: undefined,
href: partner?.id
? `/${slug}/events?event=sales&partnerId=${partner.id}&interval=1y`
? `/${slug}/events?event=sales&partnerId=${partner.id}&interval=1y&saleType=new`
: undefined,
},
{
Expand Down
2 changes: 1 addition & 1 deletion apps/web/lib/zod/schemas/partner-profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export const getPartnerCustomersQuerySchema = z
"A filter on the list based on the customer's `linkId` field (the referral link ID).",
),
sortBy: z
.enum(["createdAt", "saleAmount"])
.enum(["createdAt", "firstSaleAt", "subscriptionCanceledAt"])
.optional()
.default("createdAt")
.describe(
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default defineConfig((options: Options) => ({
},
dts: true,
minify: true,
clean: true,
clean: process.env.VERCEL === "1",
external: ["react"],
...options,
}));
2 changes: 1 addition & 1 deletion packages/utils/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default defineConfig((options: Options) => ({
format: ["esm"],
dts: true,
minify: true,
clean: true,
clean: process.env.VERCEL === "1",
external: ["react"],
...options,
}));
Loading