Skip to content

Build your personal knowledge base with Trilium Notes

refactor(website): dedicated prop for CTA

Elian Dorane2f4f17459e8
diff --git a/apps/website/src/components/Section.tsx b/apps/website/src/components/Section.tsx
index e15a3cc53e..13b213205f 100644
--- a/apps/website/src/components/Section.tsx
+++ b/apps/website/src/components/Section.tsx
@@ -1,19 +1,27 @@
import { ComponentChildren } from "preact";
+import Button from "./Button.js";
+
interface SectionProps {
title?: string;
subtitle?: string;
+ cta?: { text: string; href: string };
children: ComponentChildren;
className?: string;
}
-export default function Section({ className, title, subtitle, children }: SectionProps) {
+export default function Section({ className, title, subtitle, cta, children }: SectionProps) {
return (
<section className={className}>
<div className="content-wrapper">
{title && <h2>{title}</h2>}
{subtitle && <p className="section-subtitle">{subtitle}</p>}
{children}
+ {cta && (
+ <div className="section-cta">
+ <Button outline text={cta.text} href={cta.href} openExternally />
+ </div>
+ )}
</div>
</section>
)
diff --git a/apps/website/src/pages/Home/index.tsx b/apps/website/src/pages/Home/index.tsx
index ca03df127f..96f8f214ed 100644
--- a/apps/website/src/pages/Home/index.tsx
+++ b/apps/website/src/pages/Home/index.tsx
@@ -291,7 +291,7 @@ function CollectionsSection() {
function AiIntegrationSection() {
const { t } = useTranslation();
return (
- <Section className="benefits ai-integration" title={t("ai_integration.title")} subtitle={t("ai_integration.subtitle")}>
+ <Section className="benefits ai-integration" title={t("ai_integration.title")} subtitle={t("ai_integration.subtitle")} cta={{ text: t("ai_integration.learn_more"), href: "https://docs.triliumnotes.org/user-guide/llm" }}>
<div className="ai-integration-split">
<div className="ai-screenshot">
<img src="/feature_llm.webp" alt={t("ai_integration.screenshot_alt")} loading="lazy" />
@@ -302,10 +302,6 @@ function AiIntegrationSection() {
<Card iconSvg={apiKeyIcon} title={t("ai_integration.providers_title")}>{t("ai_integration.providers_description")}</Card>
</div>
</div>
-
- <div className="ai-integration-cta">
- <Button outline text={t("ai_integration.learn_more")} href="https://docs.triliumnotes.org/user-guide/llm" openExternally />
- </div>
</Section>
);
}