Files
supabase/apps/www/components/Enterprise/Support.tsx
Gildas Garcia c3119ea1ea chore: types cleanup for react 19 (#44941)
## Problem

While trying to update `react` to version `19`, I noticed type related
errors that can be fixed in version `18`, mostly usage of `JSX.Element`
instead of `ReactNode`.

## Solution

- Use `ReactNode` instead of `JSX.Element`
- Fix some invalid usage of `rechart`

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **Refactor**
* Standardized React component type annotations across the codebase for
improved type consistency and flexibility.
* Updated component prop types to accept a broader range of renderable
content.

* **Bug Fixes**
  * Adjusted chart layout positioning to improve visual alignment.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-04-16 15:31:04 +02:00

59 lines
1.7 KiB
TypeScript

import SectionContainer from '~/components/Layouts/SectionContainer'
import type { LucideIcon } from 'lucide-react'
import React, { type FC, type ReactNode } from 'react'
import { cn } from 'ui'
interface Props {
id: string
label?: ReactNode
heading: ReactNode
features: Feature[]
}
type Feature = {
icon: LucideIcon | any
heading: string
subheading: string
}
const Support: FC<Props> = (props) => {
return (
<SectionContainer id={props.id} className="flex flex-col gap-4 md:gap-8">
<div className="flex flex-col gap-2">
<span className="label">{props.label}</span>
<h2 className="h2">{props.heading}</h2>
</div>
<ul className="grid grid-cols-1 gap-4 gap-y-10 md:grid-cols-3 md:gap-12 xl:gap-20">
{props.features.map((feature) => (
<FeatureItem feature={feature} key={feature.heading} />
))}
</ul>
</SectionContainer>
)
}
interface FeatureItemProps {
feature: Feature
}
const FeatureItem: FC<FeatureItemProps> = ({ feature }) => {
const Icon: LucideIcon = feature.icon
const iconSize = 7
const iconWidth = `w-${iconSize}`
const iconHeight = `h-${iconSize}`
return (
<li className="flex flex-col gap-2 text-sm">
<Icon className={cn('stroke-1 mb-2 text-foreground-lighter', iconWidth, iconHeight)} />
<div className="w-full h-px overflow-hidden flex items-start bg-border-muted">
<span className={cn('h-full bg-foreground-lighter', iconWidth)} />
</div>
<h4 className="text-foreground text-lg lg:text-xl mt-1">{feature.heading}</h4>
<p className="text-foreground-lighter text-sm">{feature.subheading}</p>
{/* <TextLink hasChevron label="Read story" url={feature.url} className="mt-4" /> */}
</li>
)
}
export default Support