import AppLogo from '@/components/app-logo'; import DataSortModal from '@/components/data-sort-modal'; import Switch from '@/components/switch'; import { Button } from '@/components/ui/button'; import { Card } from '@/components/ui/card'; import { Label } from '@/components/ui/label'; import { getPageSection } from '@/lib/page'; import { cn } from '@/lib/utils'; import { SharedData } from '@/types/global'; import { Link, router, usePage } from '@inertiajs/react'; import { getYear } from 'date-fns'; import { Settings } from 'lucide-react'; const LandingFooter = () => { const { page, customize, system } = usePage().props; const aboutUsSection = getPageSection(page, 'footer_list_1'); const customerCareSection = getPageSection(page, 'footer_list_2'); const contactUsSection = getPageSection(page, 'footer_list_3'); const sections = [aboutUsSection, customerCareSection, contactUsSection] .filter((section): section is PageSection => section !== undefined) .sort((a, b) => (a.sort || 0) - (b.sort || 0)); const sectionActiveChange = (id: string | number, active: boolean) => { router.post(route('page.section.update', id), { active, }); }; return (
{customize && page && (
} onOrderChange={(newOrder, setOpen) => { router.post( route('page.section.sort'), { sortedData: newOrder, }, { preserveScroll: true, onSuccess: () => setOpen && setOpen(false) }, ); }} renderContent={(item) => (

{item.name}

sectionActiveChange(item.id, checked)} />
)} />
)}

{system.fields.description}

{sections.map( (section) => section.active && (

{section?.title}

    {section?.properties.array.map((item, itemIndex) => section.slug === 'footer_list_3' ? (
  • {item.title}
  • ) : (
  • {item.title}
  • ), )}
), )}

Copyright © {getYear(new Date())} UI Lib. All rights reserved

); }; export default LandingFooter;