react-infinity-sidebar
Version:
A fully customizable and responsive sidebar component for React applications, built with TailwindCSS and Headless UI. Easily integrate dynamic navigation menus, dark mode, and various styling options. Designed for dashboards, admin panels, and modern web
20 lines (19 loc) • 594 B
JSX
import React from 'react'; // React needs to be imported
import { Route } from 'react-router-dom';
export function getAllRoutes(routes) {
return (
<>
{routes.map((route, index) => {
const Component = route.component;
return Component ? (
<Route
key={index}
path={route.path}
name={route.name}
element={<Component />}
/>
) : null;
})};
</>
)
}