mirror of
https://github.com/supabase/supabase.git
synced 2026-10-11 20:35:07 +03:00
* fix: date range picker dropdown width This fixes the date range pickers width on the Usage section. No more crumpled up menu items. * chore: remove AI slop empty classes * feat: get rid of legacy scaffold header on usage page * chore: remove legacy scaffold from no permissions layout on usage * feat: improve styling for sticky header area * nit: small uppercase for a p * fix: padding for no permission banner Was missing the ScaffoldHeader wrapper * feat: update loading skeleton for header area * style: same breakpoints for header loading skeletons * feat: remove ListBox in favour or Select_Shadcn_ for our project dropdown * fix: logic for admonition when project is selected * fix: remove rogue border from total usage grid * fix: use proper background colour for sticky bar * fix: more info link click area * fix: reduce width of hover card on compute metrics * feat: remove separator from usage section headers * fix: revert width of hover cards for compute and billing metric * fix type size and chevron tint * only wrap anchored metrics in Link otherwise non-anchored metrics get #undefined Link and unnecessary pointer * style: shore up sections with headers * fix: reset select state to undefined The setSelectedProjectRef was causing our rings not to show on the usage table. * Fixy * Nit refactors and fixes --------- Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com> Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
67 lines
2.5 KiB
TypeScript
67 lines
2.5 KiB
TypeScript
import { ScaffoldContainer, ScaffoldDivider } from 'components/layouts/Scaffold'
|
|
import { ExternalLink } from 'lucide-react'
|
|
import Link from 'next/link'
|
|
import { PropsWithChildren } from 'react'
|
|
import { Badge } from 'ui'
|
|
import { CategoryAttribute } from './Usage.constants'
|
|
|
|
export interface SectionContent {
|
|
section: Pick<CategoryAttribute, 'name' | 'description' | 'links'>
|
|
includedInPlan?: boolean
|
|
}
|
|
|
|
export const SectionContent = ({
|
|
section,
|
|
includedInPlan,
|
|
children,
|
|
}: PropsWithChildren<SectionContent>) => {
|
|
const { name, description, links } = section
|
|
|
|
return (
|
|
<>
|
|
<ScaffoldContainer>
|
|
<div className="mx-auto flex flex-col gap-10 py-8 md:py-16">
|
|
<div className="grid grid-cols-12 gap-6">
|
|
<div className="col-span-12 lg:col-span-5">
|
|
<div className="sticky top-32 space-y-6">
|
|
<div className="space-y-1">
|
|
<div className="flex items-center space-x-2">
|
|
<p className="text-base capitalize">{name}</p>
|
|
{includedInPlan === false && <Badge>Not included</Badge>}
|
|
</div>
|
|
<div className="grid gap-4">
|
|
{description.split('\n').map((value, idx) => (
|
|
<p key={`desc-${idx}`} className="text-sm text-foreground-light pr-8">
|
|
{value}
|
|
</p>
|
|
))}
|
|
</div>
|
|
</div>
|
|
{links && links.length > 0 && (
|
|
<div className="space-y-2">
|
|
<p className="text-xs font-mono uppercase text-foreground-lighter mb-2">
|
|
More information
|
|
</p>
|
|
{links.map((link) => (
|
|
<div key={link.url}>
|
|
<Link href={link.url} target="_blank" rel="noreferrer">
|
|
<div className="inline-flex items-center space-x-2 text-foreground-light hover:text-foreground transition">
|
|
<p className="text-sm">{link.name}</p>
|
|
<ExternalLink size={16} strokeWidth={1.5} />
|
|
</div>
|
|
</Link>
|
|
</div>
|
|
))}
|
|
</div>
|
|
)}
|
|
</div>
|
|
</div>
|
|
<div className="col-span-12 lg:col-span-7 space-y-6">{children}</div>
|
|
</div>
|
|
</div>
|
|
</ScaffoldContainer>
|
|
<ScaffoldDivider />
|
|
</>
|
|
)
|
|
}
|