Update legal documents and localization for compliance and clarity
- Updated .env.example with legal operator details for compliance. - Refactored Impressum, Privacy, and Terms pages to utilize a new LegalDocument component for improved structure and maintainability. - Enhanced localization files to include legal content in both German and English, ensuring accurate representation of legal information. - Improved i18n handling to support locale detection from Accept-Language headers.
This commit is contained in:
47
apps/webui/src/components/site/legal-document.tsx
Normal file
47
apps/webui/src/components/site/legal-document.tsx
Normal file
@@ -0,0 +1,47 @@
|
||||
import { MESSAGES, type Locale } from '@/lib/i18n';
|
||||
|
||||
type LegalSection = {
|
||||
heading?: string;
|
||||
paragraphs?: string[];
|
||||
lines?: string[];
|
||||
list?: string[];
|
||||
};
|
||||
|
||||
export function LegalDocument({
|
||||
locale,
|
||||
page
|
||||
}: {
|
||||
locale: Locale;
|
||||
page: 'impressum' | 'privacy' | 'terms';
|
||||
}) {
|
||||
const legal = MESSAGES[locale].legal[page];
|
||||
const sections = legal.sections as LegalSection[];
|
||||
|
||||
return (
|
||||
<>
|
||||
<p className="text-sm text-muted-foreground">{MESSAGES[locale].legal.updated}</p>
|
||||
{sections.map((section) => (
|
||||
<section key={section.heading} className="space-y-3">
|
||||
{section.heading ? <h2 className="text-lg font-semibold">{section.heading}</h2> : null}
|
||||
{section.paragraphs?.map((paragraph) => (
|
||||
<p key={paragraph.slice(0, 48)} className="text-sm leading-relaxed text-muted-foreground">
|
||||
{paragraph}
|
||||
</p>
|
||||
))}
|
||||
{section.lines && section.lines.length > 0 ? (
|
||||
<p className="whitespace-pre-line text-sm leading-relaxed text-muted-foreground">
|
||||
{section.lines.join('\n')}
|
||||
</p>
|
||||
) : null}
|
||||
{section.list && section.list.length > 0 ? (
|
||||
<ul className="list-disc space-y-1 pl-5 text-sm leading-relaxed text-muted-foreground">
|
||||
{section.list.map((item) => (
|
||||
<li key={item.slice(0, 48)}>{item}</li>
|
||||
))}
|
||||
</ul>
|
||||
) : null}
|
||||
</section>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user