import React from 'react'; import type { ComponentConfig } from '@measured/puck'; import { Twitter, Linkedin, Github, Facebook, Instagram, Youtube } from 'lucide-react'; export interface FooterLink { label: string; href: string; } export interface FooterColumn { title: string; links: FooterLink[]; } export interface SocialLinks { twitter?: string; linkedin?: string; github?: string; facebook?: string; instagram?: string; youtube?: string; } export interface MiniCta { text: string; placeholder: string; buttonText: string; } export interface FooterProps { brandText: string; brandLogo?: string; description?: string; columns: FooterColumn[]; socialLinks?: SocialLinks; smallPrint?: string; miniCta?: MiniCta; } const socialIcons = { twitter: Twitter, linkedin: Linkedin, github: Github, facebook: Facebook, instagram: Instagram, youtube: Youtube, }; const FooterRender: React.FC = ({ brandText, brandLogo, description, columns, socialLinks, smallPrint, miniCta, }) => { const hasSocialLinks = socialLinks && Object.values(socialLinks).some(Boolean); return ( ); }; export const Footer: ComponentConfig = { label: 'Footer', fields: { brandText: { type: 'text', label: 'Brand Name', }, brandLogo: { type: 'text', label: 'Brand Logo URL', }, description: { type: 'textarea', label: 'Description', }, columns: { type: 'array', label: 'Link Columns', arrayFields: { title: { type: 'text', label: 'Column Title' }, links: { type: 'array', label: 'Links', arrayFields: { label: { type: 'text', label: 'Label' }, href: { type: 'text', label: 'URL' }, }, }, }, defaultItemProps: { title: 'Column', links: [ { label: 'Link 1', href: '#' }, { label: 'Link 2', href: '#' }, ], }, }, socialLinks: { type: 'object', label: 'Social Links', objectFields: { twitter: { type: 'text', label: 'Twitter URL' }, linkedin: { type: 'text', label: 'LinkedIn URL' }, github: { type: 'text', label: 'GitHub URL' }, facebook: { type: 'text', label: 'Facebook URL' }, instagram: { type: 'text', label: 'Instagram URL' }, youtube: { type: 'text', label: 'YouTube URL' }, }, }, smallPrint: { type: 'text', label: 'Copyright/Small Print', }, miniCta: { type: 'object', label: 'Newsletter CTA (optional)', objectFields: { text: { type: 'text', label: 'Heading' }, placeholder: { type: 'text', label: 'Placeholder' }, buttonText: { type: 'text', label: 'Button Text' }, }, }, }, defaultProps: { brandText: 'Your Business', description: 'Add a brief description of your business here.', columns: [ { title: 'Navigation', links: [ { label: 'Home', href: '#' }, { label: 'About', href: '#' }, { label: 'Services', href: '#' }, ], }, { title: 'Contact', links: [ { label: 'Contact Us', href: '#' }, { label: 'Support', href: '#' }, { label: 'Location', href: '#' }, ], }, { title: 'Legal', links: [ { label: 'Privacy Policy', href: '#' }, { label: 'Terms of Service', href: '#' }, ], }, ], socialLinks: {}, smallPrint: '© 2024 Your Business. All rights reserved.', }, render: FooterRender, }; export default Footer;