Files
botsmann/components/shared/BotSection.tsx
T
g-butandClaude Opus 4.5 a192ca24a0 refactor: centralize bot page configuration and add shared components
- Add BotSection and BotNotFoundFallback shared components
- Centralize menuItems and navigation config in data/bots.ts
- Add getBotBySlug and getBotTryLink helper functions
- Add BotMenuItem, BotAccentColor, and BotNavConfig types
- Refactor all 6 bot pages to use centralized configuration
- Remove ~180 lines of duplicated code across bot pages
- Improve consistency in error handling and section spacing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 21:24:47 +01:00

32 lines
653 B
TypeScript

import { type FC, type ReactNode } from 'react';
interface BotSectionProps {
id: string;
children: ReactNode;
className?: string;
isLast?: boolean;
}
/**
* Standardized section wrapper for bot pages
* Provides consistent spacing, scroll-margin for navigation, and section IDs
*/
export const BotSection: FC<BotSectionProps> = ({
id,
children,
className = '',
isLast = false,
}) => {
const baseClasses = 'scroll-mt-24';
const spacingClasses = isLast ? 'mb-24' : 'my-16';
return (
<section
id={id}
className={`${baseClasses} ${spacingClasses} ${className}`.trim()}
>
{children}
</section>
);
};