Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 51 additions & 45 deletions app/[lang]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,58 +1,64 @@
import './global.css';
import { RootProvider } from 'fumadocs-ui/provider';
import type { ReactNode } from 'react';
import { I18nProvider } from 'fumadocs-ui/i18n';
import "./global.css";
import { RootProvider } from "fumadocs-ui/provider";
import type { ReactNode } from "react";
import { I18nProvider } from "fumadocs-ui/i18n";
import Footer from "@/components/footer";

export default async function Layout({
export default async function Layout({
params,
children,
}: {
params: Promise<{ lang: string }>;
children: ReactNode;
}) {
const { lang } = await params;
const includeCzech = process.env.NEXT_PUBLIC_CZECH === 'true';
const includeCzech = process.env.NEXT_PUBLIC_CZECH === "true";
return (
<html lang={lang} suppressHydrationWarning>
<body className="flex flex-col min-h-screen">
<I18nProvider
locale={lang}
locales={[
{
name: 'English',
locale: 'en',
},
...(includeCzech ? [
<>
<html lang={lang} suppressHydrationWarning>
<body className="flex flex-col min-h-screen">
<I18nProvider
locale={lang}
locales={[
{
name: 'Česky',
locale: 'cz',
}
] : [])
]}
translations={
{
cz: {
toc: 'Obsah',
search: 'Hledat',
lastUpdate: 'Poslední změna',
searchNoResult: 'Žádný výsledek',
tocNoHeadings: 'Bez nadpisů',
previousPage: 'Předchozí',
nextPage: 'Následující',
chooseLanguage: 'Jazyk',
name: "English",
locale: "en",
},
}[lang]
}
>
<RootProvider
theme={{
enabled: false,
}}
>
{children}
</RootProvider>
</I18nProvider>
</body>
</html>
...(includeCzech
? [
{
name: "Česky",
locale: "cz",
},
]
: []),
]}
translations={
{
cz: {
toc: "Obsah",
search: "Hledat",
lastUpdate: "Poslední změna",
searchNoResult: "Žádný výsledek",
tocNoHeadings: "Bez nadpisů",
previousPage: "Předchozí",
nextPage: "Následující",
chooseLanguage: "Jazyk",
},
}[lang]
}
>
<RootProvider
theme={{
enabled: false,
}}
>
{children}
</RootProvider>
</I18nProvider>
</body>
</html>
<Footer />
</>
);
}
18 changes: 9 additions & 9 deletions app/layout.config.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
import Image from 'next/image';
import Logo from '@/public/img/e-infra/logo.svg';
import type { BaseLayoutProps } from "fumadocs-ui/layouts/shared";
import Image from "next/image";
import Logo from "@/public/img/e-infra/logo.svg";
import Footer from "@/components/footer";

/**
* Shared layout configurations
Expand All @@ -13,13 +14,12 @@ export const baseOptions: BaseLayoutProps = {
i18n: true,
nav: {
title: (
<>
<Image src={Logo} alt="einfra logo" width="50" height="19"/>
Documentation
</>
<>
<Image src={Logo} alt="einfra logo" width="50" height="19" />
Documentation
</>
),
},
links: [
],
links: [],
disableThemeSwitch: true,
};
2 changes: 1 addition & 1 deletion components/ai/engines/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export async function createOpenAIEngine(url: string, embed: boolean): Promise<E
messages.push({ role: 'user', content: text});
messages.push({ role: 'assistant', content: "Searching documents ..."});
const context = await buildEnhancedPrompt(text);
onUpdate && onUpdate(''); // change 'searching documents' to 'generating answer'
onUpdate?.(''); // change 'searching documents' to 'generating answer'
messages.pop();
messages[0].context = context;
} else {
Expand Down
7 changes: 5 additions & 2 deletions components/ai/search-ai.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ function Message({
};

void run();
}, [message.content]);
}, [message.content, onInternalLinkClicked]);

return (
<div
Expand Down Expand Up @@ -472,6 +472,7 @@ const CustomLink = forwardRef<HTMLAnchorElement, CustomLinkProps>(
{...props} />
},
);
CustomLink.displayName = "FunctionLink"

const typeButtonVariants = cva(
'inline-flex items-center justify-center rounded-lg px-2 py-1 text-sm font-medium transition-colors duration-100',
Expand Down Expand Up @@ -505,6 +506,8 @@ export function Trigger({
] as const;
const [type, setType] = useState<EngineType>(engines[0]?.value ?? 'local');
const [open, setOpen] = useState<boolean>(false);

const closeDialog = useCallback(() => setOpen(false), [])

return (
<Dialog open={open} onOpenChange={setOpen} >
Expand Down Expand Up @@ -558,7 +561,7 @@ export function Trigger({
Ask questions from this documentation or try to paste and resolve errors you get.
</p>
</div>
<AIDialog type={type} onCloseDialog={() => setOpen(false)}/>
<AIDialog type={type} onCloseDialog={closeDialog}/>
</DialogContent>
</DialogPortal>
</Dialog>
Expand Down
101 changes: 101 additions & 0 deletions components/footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import React from "react";
import Link from "next/link";
import { Clock, Mail, Phone } from "lucide-react";
import RedirectListItem from "./redirection/redirect-list-item";

const Version = Date.now();

const Footer: React.FC = () => {
return (
<footer className="flex flex-col mt-0 md:mt-12 items-center px-5 bg-gray-100 border-t border-gray-300 pb-5">
<div className="container md:flex sm:flex-row justify-between gap-5 items-center mb-8 max-w-[1100px]">
<div className="flex-1 px-2 mt-8 justify-center">
<h4 className="font-semibold mb-3">e-INFRA CZ</h4>
<ul>
<li>
<p className="text-sm text-fd-muted-foreground">
<span className="whitespace-nowrap">CERIT-SC</span>,{" "}
<span className="whitespace-nowrap">CESNET</span>, and{" "}
<span className="whitespace-nowrap">IT4Innovations</span> are
the three{" "}
<span className="whitespace-nowrap">e-infrastructures</span>{" "}
that constitute the national{" "}
<span className="whitespace-nowrap">e-INFRA CZ</span> research
infrastructure.
</p>
</li>
</ul>
</div>
<div className="flex-1 mt-8 px-2">
<h4 className="font-semibold mb-2">General information</h4>
<ul>
<RedirectListItem
href="https://blog.e-infra.cz/"
text="e-INFRA CZ Blog"
/>
<RedirectListItem
href="https://e-infra.cz/"
text="e-INFRA CZ Website"
/>
<RedirectListItem
href="https://docs.e-infra.cz/account/mfa/setup"
text="Documentation on Github"
/>
</ul>
</div>
<div className="flex-1 px-2 mt-8 h-full">
<h4 className="font-semibold mb-2">e-INFRA CZ Support</h4>
<ul>
<li className="flex items-center gap-2">
<Clock className="w-4 pt-[2px] h-4 text-fd-primary" />
<p className="text-fd-muted-foreground">Available non-stop</p>
</li>
<li className="flex pt-[2px] items-center gap-2">
<Mail className="w-4 h-4 text-fd-primary" />
<Link
href="mailto:[email protected]"
className="text-fd-primary hover:underline"
>
[email protected]
</Link>
</li>
<li className="flex pt-[2px] items-center gap-2">
<Phone className="w-4 h-4 text-fd-primary" />
<p className="text-fd-muted-foreground">+420 234 680 222</p>
</li>
</ul>
</div>
</div>

<div className="container md:flex sm:flex-row sm:mt-4 justify-center items-center gap-4 mt-4 max-w-[1100px] rounded-md bg-slate-100">
<img
src="/img/logos/footer-partner-logos.svg"
alt="CESNET Logo"
className="h-14 w-auto"
/>
</div>
<hr className="mt-8 mb-4 border-t-2 border-gray-200 w-full" />
<div className="container md:flex sm:flex-row justify-center md:justify-between items-center max-w-[1100px]">
<div className="flex items-center justify-center md:justify-start gap-1">
<p className="text-sm text-fd-muted-foreground">
Copyright © 2025 e-INFRA CZ
</p>
<p className="text-sm text-fd-muted-foreground px-1 pb-[1px]">|</p>
<Link
href="https://www.e-infra.cz/en/personal-data-processing"
className="text-sm text-fd-primary hover:underline"
>
Privacy Policy
</Link>
</div>
<div className="flex items-center justify-center md:justify-end gap-1 pt-4 md:pt-0">
<p className="text-sm text-fd-muted-foreground">
Version: {new Date(Version).toLocaleDateString("cs-CS")}
</p>
</div>
</div>
</footer>
);
};

export default Footer;
21 changes: 21 additions & 0 deletions components/redirection/redirect-list-item.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from "react";
import Link from "next/link";
import { MoveRight } from "lucide-react";

interface RedirectListItemProps {
href: string;
text: string;
}

const RedirectListItem: React.FC<RedirectListItemProps> = ({ href, text }) => {
return (
<li>
<Link href={href} className="text-fd-primary flex items-center gap-2">
<MoveRight className="pt-[3px]" />
{text}
</Link>
</li>
);
};

export default RedirectListItem;
1 change: 1 addition & 0 deletions public/img/logos/footer-partner-logos.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.