Files
overleaf-cep/services/web/frontend/js/features/integrations-panel/integration-card.tsx
T
Davinder Singh b7f5344859 Tearing down of old Editor (Integrations panel) and other files (#31701)
* moving files from ide-redesign/components/editor-tour to features/editor-tour

moving files from ide-redesign/components/integrations-panel to features/integrations-panel

fixing imports

Revert "moving files from ide-redesign/components/editor-tour to features/editor-tour"

This reverts commit 9e4dcd4e001ffa4bfdb1053fb8824c1e8521ab10.

* moving files from ide-redesign/components/help -> ide-react/components/rail

* ide-redesign/components/breadcrumbs → features/source-editor/extensions

* ide-redesign/components/editor.tsx → ide-react/components/layout

* ide-redesign/components/full-project-search-panel.tsx → ide-react/components/rail/full-project-search-panel.tsx

* removing old-editor-warning-tooltip

* ide-redesign/components/tooltip-promo.tsx → shared/components/tooltip-promo.tsx

make cleanup_unused_locales

* extract-translations

GitOrigin-RevId: b9f44c4820bb4e0a7eef4f6f9a58ff96fd007bf9
2026-03-06 09:06:48 +00:00

64 lines
1.5 KiB
TypeScript

import OLBadge from '@/shared/components/ol/ol-badge'
import MaterialIcon from '@/shared/components/material-icon'
import { useTranslation } from 'react-i18next'
export default function IntegrationCard({
href,
onClick,
title,
description,
icon,
showPaywallBadge,
}: {
href?: string
onClick?: () => void
title: string
description: string
icon: React.ReactNode
showPaywallBadge: boolean
}) {
const { t } = useTranslation()
const content = (
<div className="integrations-panel-card-contents">
<div className="integrations-panel-card-icon">{icon}</div>
<div className="integrations-panel-card-inner">
<div className="integrations-panel-card-header">
<div className="integrations-panel-card-title" translate="no">
{title}
</div>
{showPaywallBadge && (
<OLBadge
prepend={<MaterialIcon type="star" />}
bg="light"
className="integrations-panel-card-premium-badge"
>
{t('premium')}
</OLBadge>
)}
</div>
<p className="integrations-panel-card-description">{description}</p>
</div>
</div>
)
if (href) {
return (
<a
href={href}
target="_blank"
rel="noreferrer"
className="integrations-panel-card-button"
>
{content}
</a>
)
}
return (
<button onClick={onClick} className="integrations-panel-card-button">
{content}
</button>
)
}