UNPKG

react-vite-themes

Version:

A test/experimental React theme system created for learning purposes. Features atomic design components, SCSS variables, and dark/light theme support. Not intended for production use.

18 lines (17 loc) 2.58 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import React from 'react'; import { Icon } from '../../atoms/Icon'; import './Footer.scss'; export const Footer = ({ sections = [], companyName = 'Your Company', companyDescription = 'Building amazing experiences with modern web technologies.', socialLinks = [], copyrightText, className = '', showBackToTop = true, onBackToTop, container = true, }) => { const currentYear = new Date().getFullYear(); const defaultCopyright = `© ${currentYear} ${companyName}. All rights reserved.`; const handleBackToTop = () => { if (onBackToTop) { onBackToTop(); } else { window.scrollTo({ top: 0, behavior: 'smooth' }); } }; return (_jsx("footer", { className: `footer ${className}`, children: _jsxs("div", { className: `footer-content ${container ? 'container' : ''}`, children: [_jsxs("div", { className: "footer-main", children: [_jsxs("div", { className: "footer-brand", children: [_jsx("h3", { className: "footer-company-name", children: companyName }), _jsx("p", { className: "footer-description", children: companyDescription }), socialLinks.length > 0 && (_jsx("div", { className: "footer-social", children: socialLinks.map((link, index) => (_jsx("a", { href: link.href, target: link.external ? '_blank' : undefined, rel: link.external ? 'noopener noreferrer' : undefined, className: "footer-social-link", "aria-label": link.label, children: _jsx(Icon, { name: link.label.toLowerCase(), size: "sm" }) }, index))) }))] }), sections.length > 0 && (_jsx("div", { className: "footer-sections", children: sections.map((section, sectionIndex) => (_jsxs("div", { className: "footer-section", children: [_jsx("h4", { className: "footer-section-title", children: section.title }), _jsx("ul", { className: "footer-links", children: section.links.map((link, linkIndex) => (_jsx("li", { className: "footer-link-item", children: _jsx("a", { href: link.href, target: link.external ? '_blank' : undefined, rel: link.external ? 'noopener noreferrer' : undefined, className: "footer-link", children: link.label }) }, linkIndex))) })] }, sectionIndex))) }))] }), _jsxs("div", { className: "footer-bottom", children: [_jsx("div", { className: "footer-copyright", children: _jsx("p", { className: "copyright-text", children: copyrightText || defaultCopyright }) }), showBackToTop && (_jsx("button", { onClick: handleBackToTop, className: "footer-back-to-top", "aria-label": "Back to top", children: _jsx(Icon, { name: "arrow-up", size: "sm" }) }))] })] }) })); };