import React, { useState } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import PropTypes from 'prop-types'; const SimpleTabs = ({ tabs, defaultTab = null }) => { const [activeTab, setActiveTab] = useState(defaultTab || (tabs.length > 0 ? tabs[0].id : '')); return (
{/* Tab Headers */}
{tabs.map((tab) => ( ))}
{/* Tab Content */} {tabs.map((tab) => ( activeTab === tab.id && ( {tab.content} ) ))}
); }; SimpleTabs.propTypes = { tabs: PropTypes.arrayOf( PropTypes.shape({ id: PropTypes.string.isRequired, label: PropTypes.string.isRequired, icon: PropTypes.node, content: PropTypes.node.isRequired, }) ).isRequired, defaultTab: PropTypes.string, }; export default SimpleTabs;