Files
Ivan VasilovandJoshen Lim 05a542ccea chore: Migrate all feather icons to lucide icons (#29038)
* Add lucide-react to docs (to make the autocomplete work).

* Migrate the docs app icons.

* Migrate the ui-patterns.

* Remove the old icons from ui package.

* Migrate the www app from react-feather icons.

* Migrate all of studio icons.

* Migrate the only component in design-system.

* Fix an old import in ui package. Revert an import in docs app.

* Fix some pages in www.

* Remove unneeded files used in generation of icons.

* Fix a prettier error.

* Fix more issues in www.

* Fix an issue in Log Date picker.

* Replace all string sizes with number sizes because the icons grew in some cases.

* Fix more imports in security page.

* Fix an extra import.

* Remove the size prop from all icons if they're in a button and they match the button size.

* Minor fixes for docs and www.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-09-04 19:46:21 +08:00

67 lines
2.4 KiB
TypeScript

import { ScaffoldContainer, ScaffoldDivider } from 'components/layouts/Scaffold'
import Link from 'next/link'
import { PropsWithChildren } from 'react'
import { Badge } from 'ui'
import { CategoryAttribute } from './Usage.constants'
import { ExternalLink } from 'lucide-react'
export interface SectionContent {
section: Pick<CategoryAttribute, 'name' | 'description' | 'links'>
includedInPlan?: boolean
}
const SectionContent = ({
section,
includedInPlan,
children,
}: PropsWithChildren<SectionContent>) => {
const { name, description, links } = section
return (
<>
<ScaffoldContainer>
<div className="mx-auto flex flex-col gap-10 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-sm text-foreground mb-2">More information</p>
{links.map((link) => (
<div key={link.url}>
<Link href={link.url} target="_blank" rel="noreferrer">
<div className="flex items-center space-x-2 opacity-50 hover:opacity-100 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 />
</>
)
}
export default SectionContent