import { faExternalLinkAlt, faPlus } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { Button, Card } from '@shlinkio/shlink-frontend-kit'; import { clsx } from 'clsx'; import type { FC } from 'react'; import { useEffect } from 'react'; import { ExternalLink } from 'react-external-link'; import { useNavigate } from 'react-router'; import { withoutSelectedServer } from '../servers/helpers/withoutSelectedServer'; import { useServers } from '../servers/reducers/servers'; import { ServersListGroup } from '../servers/ServersListGroup'; import { ShlinkLogo } from './img/ShlinkLogo'; export const Home: FC = withoutSelectedServer(() => { const navigate = useNavigate(); const { servers } = useServers(); const serversList = Object.values(servers); const hasServers = serversList.length > 0; useEffect(() => { // Try to redirect to the first server marked as auto-connect const autoConnectServer = serversList.find(({ autoConnect }) => autoConnect); if (autoConnectServer) { navigate(`/server/${autoConnectServer.id}`); } }, [serversList, navigate]); return (
This application will help you manage your Shlink servers.