The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Update route.tsx
Kiran K08da49c86926
diff --git a/apps/web/app/(ee)/app.dub.co/invoices/[invoiceId]/route.tsx b/apps/web/app/(ee)/app.dub.co/invoices/[invoiceId]/route.tsxindex b0f3e7cd54..9079d09a01 100644--- a/apps/web/app/(ee)/app.dub.co/invoices/[invoiceId]/route.tsx+++ b/apps/web/app/(ee)/app.dub.co/invoices/[invoiceId]/route.tsx@@ -317,68 +317,70 @@ export const GET = withSession(async ({ session, params }) => {</View></View>- <View style={tw("mb-6 border border-neutral-200 rounded-xl")}>- <View style={tw("flex-row border-neutral-200 border-b")}>- <Text- style={tw("w-2/6 p-3.5 text-sm font-medium text-neutral-700")}- >- Partner- </Text>- <Text- style={tw("w-2/6 p-3.5 text-sm font-medium text-neutral-700")}- >- Period- </Text>- <Text- style={tw("w-1/6 p-3.5 text-sm font-medium text-neutral-700")}- >- Amount- </Text>- </View>-- {invoice.payouts.map((payout, index) => (- <View- key={index}- style={tw(- `flex-row text-sm font-medium text-neutral-700 border-neutral-200 items-center ${index + 1 === invoice.payouts.length ? "" : "border-b"}`,- )}- >- <View style={tw("flex-row items-center gap-2 w-2/6 p-3.5")}>- <Image- src={- payout.partner.image ??- `${OG_AVATAR_URL}${payout.partner.name}`- }- style={tw("w-5 h-5 rounded-full")}- />- <Text>{payout.partner.name}</Text>- </View>- <Text style={tw("w-2/6 p-3.5")}>- {payout.periodStart && payout.periodEnd ? (- <>- {formatDate(payout.periodStart, {- month: "short",- year:- new Date(payout.periodStart).getFullYear() ===- new Date(payout.periodEnd).getFullYear()- ? undefined- : "numeric",- })}- -{formatDate(payout.periodEnd, { month: "short" })}- </>- ) : (- "-"- )}+ {invoice.payouts.length > 0 && (+ <View style={tw("mb-6 border border-neutral-200 rounded-xl")}>+ <View style={tw("flex-row border-neutral-200 border-b")}>+ <Text+ style={tw("w-2/6 p-3.5 text-sm font-medium text-neutral-700")}+ >+ Partner</Text>- <Text style={tw("w-1/6 p-3.5")}>- {currencyFormatter(payout.amount / 100, {- minimumFractionDigits: 2,- maximumFractionDigits: 2,- })}+ <Text+ style={tw("w-2/6 p-3.5 text-sm font-medium text-neutral-700")}+ >+ Period+ </Text>+ <Text+ style={tw("w-1/6 p-3.5 text-sm font-medium text-neutral-700")}+ >+ Amount</Text></View>- ))}- </View>++ {invoice.payouts.map((payout, index) => (+ <View+ key={index}+ style={tw(+ `flex-row text-sm font-medium text-neutral-700 border-neutral-200 items-center ${index + 1 === invoice.payouts.length ? "" : "border-b"}`,+ )}+ >+ <View style={tw("flex-row items-center gap-2 w-2/6 p-3.5")}>+ <Image+ src={+ payout.partner.image ??+ `${OG_AVATAR_URL}${payout.partner.name}`+ }+ style={tw("w-5 h-5 rounded-full")}+ />+ <Text>{payout.partner.name}</Text>+ </View>+ <Text style={tw("w-2/6 p-3.5")}>+ {payout.periodStart && payout.periodEnd ? (+ <>+ {formatDate(payout.periodStart, {+ month: "short",+ year:+ new Date(payout.periodStart).getFullYear() ===+ new Date(payout.periodEnd).getFullYear()+ ? undefined+ : "numeric",+ })}+ -{formatDate(payout.periodEnd, { month: "short" })}+ </>+ ) : (+ "-"+ )}+ </Text>+ <Text style={tw("w-1/6 p-3.5")}>+ {currencyFormatter(payout.amount / 100, {+ minimumFractionDigits: 2,+ maximumFractionDigits: 2,+ })}+ </Text>+ </View>+ ))}+ </View>+ )}<Viewstyle={tw(