mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
Whenever customers run into their 2 Free Plan project limit, we were previously just listed the affected members: <img width="1044" height="566" alt="image" src="https://github.com/user-attachments/assets/d1c1327d-2532-4d8e-8af2-425da9ce1ee5" /> While this lists the affected members, it is pretty unclear which organizations are affected or which projects contribute to this and what the best course of action is. This PR revamps all components that are displayed in this situation (new project launch, downgrade to Free, project unpause) to show the affected organizations + projects primarily and give more actionable tips: <img width="1014" height="638" alt="Screenshot 2026-11-11 at 3 57 45 PM (1)" src="https://github.com/user-attachments/assets/ae38f71d-bbde-4181-a623-24bef778afee" /> <img width="768" height="152" alt="image" src="https://github.com/user-attachments/assets/b3b0efd7-678b-4ac0-9602-4cc5d735a9aa" /> --- Additionally, this contains small improvements to the downgrade flow: - Rename button to "Downgrade Now" as opposed to "Confirm" to make it more clear that this is immediate - Explicitly mention downgrades are immediate and there is still another invoice for unbilled usage - Larger modal width for improved readability
63 lines
2.3 KiB
TypeScript
63 lines
2.3 KiB
TypeScript
import { BoxesIcon } from 'lucide-react'
|
|
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Card } from 'ui'
|
|
|
|
import { InlineLink } from './InlineLink'
|
|
import { type MemberWithFreeProjectLimit } from '@/data/organizations/free-project-limit-check-query'
|
|
|
|
export const ExceedFreeProjectLimitMembers = ({
|
|
membersExceededLimit,
|
|
}: {
|
|
membersExceededLimit: MemberWithFreeProjectLimit[]
|
|
}) => {
|
|
return (
|
|
<>
|
|
<p>Members exceeding limit:</p>
|
|
<Card>
|
|
<Accordion type="multiple">
|
|
{membersExceededLimit?.map((member) => (
|
|
<AccordionItem
|
|
className="px-4 last:border-b-0"
|
|
key={member.primary_email}
|
|
value={member.primary_email}
|
|
>
|
|
<AccordionTrigger>
|
|
<p className="mb-0! flex items-center gap-x-2">
|
|
<span>{member.primary_email}</span>
|
|
<span className="text-foreground-light">
|
|
(Limit: {member.free_project_limit} free projects)
|
|
</span>
|
|
</p>
|
|
</AccordionTrigger>
|
|
<AccordionContent className="[&>div]:flex [&>div]:flex-col [&>div]:gap-y-2">
|
|
{member.free_plan_organizations.map((org) => (
|
|
<div key={org.slug || org.organization_name}>
|
|
<InlineLink
|
|
href={`/org/${org.slug ?? '_'}/billing`}
|
|
className="flex items-center gap-x-2"
|
|
>
|
|
<BoxesIcon size={14} />
|
|
<p>{org.organization_name}</p>
|
|
</InlineLink>
|
|
<ul className="list-disc! pl-6!">
|
|
{org.projects.map((project) => (
|
|
<li key={project.ref || project.name}>
|
|
<InlineLink
|
|
className="text-foreground-light"
|
|
href={`/project/${project.ref || '_'}`}
|
|
>
|
|
{project.name}
|
|
</InlineLink>
|
|
</li>
|
|
))}
|
|
</ul>
|
|
</div>
|
|
))}
|
|
</AccordionContent>
|
|
</AccordionItem>
|
|
))}
|
|
</Accordion>
|
|
</Card>
|
|
</>
|
|
)
|
|
}
|