import { NavPillItem, NavPills } from '@shlinkio/shlink-frontend-kit'; import type { FC, ReactNode } from 'react'; import { Navigate, Route, Routes } from 'react-router-dom'; import { NoMenuLayout } from '../common/NoMenuLayout'; import type { FCWithDeps } from '../container/utils'; import { componentFactory, useDependencies } from '../container/utils'; type SettingsDeps = { RealTimeUpdatesSettings: FC; ShortUrlCreationSettings: FC; ShortUrlsListSettings: FC; UserInterfaceSettings: FC; VisitsSettings: FC; TagsSettings: FC; }; const SettingsSections: FC<{ items: ReactNode[] }> = ({ items }) => ( <> {items.map((child, index) =>
{child}
)} ); const Settings: FCWithDeps<{}, SettingsDeps> = () => { const { RealTimeUpdatesSettings: RealTimeUpdates, ShortUrlCreationSettings: ShortUrlCreation, ShortUrlsListSettings: ShortUrlsList, UserInterfaceSettings: UserInterface, VisitsSettings: Visits, TagsSettings: Tags, } = useDependencies(Settings); return ( General Short URLs Other items , ]} />} /> , ]} />} /> , ]} />} /> } /> ); }; export const SettingsFactory = componentFactory(Settings, [ 'RealTimeUpdatesSettings', 'ShortUrlCreationSettings', 'ShortUrlsListSettings', 'UserInterfaceSettings', 'VisitsSettings', 'TagsSettings', ]);