import { FC, useEffect } from 'react'; import { faCheck as defaultDomainIcon, faEdit as editIcon, faBan as forbiddenIcon } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { Button, UncontrolledTooltip } from 'reactstrap'; import Message from '../utils/Message'; import { Result } from '../utils/Result'; import { ShlinkApiError } from '../api/ShlinkApiError'; import { SimpleCard } from '../utils/SimpleCard'; import { DomainsList } from './reducers/domainsList'; import SearchField from '../utils/SearchField'; interface ManageDomainsProps { listDomains: Function; domainsList: DomainsList; } const Na: FC = () => N/A; const DefaultDomain: FC = () => ( <> Default domain ); export const ManageDomains: FC = ({ listDomains, domainsList }) => { const { domains, loading, error } = domainsList; useEffect(() => { listDomains(); }, []); const renderContent = () => { if (loading) { return ; } if (error) { return ( ); } return ( {domains.map((domain) => ( ))}
Domain Base path redirect Regular 404 redirect Invalid short URL redirect
{domain.isDefault ? : ''} {domain.domain} {domain.redirects?.baseUrlRedirect ?? } {domain.redirects?.regular404Redirect ?? } {domain.redirects?.invalidShortUrlRedirect ?? } {domain.isDefault && ( Redirects for default domain cannot be edited here. )}
); }; return ( <> {}} /> {renderContent()} ); };