11import React , { useState } from 'react' ;
2+ import { Button , EmptyStateLayout } from '@strapi/design-system' ;
23import { useSelector , useDispatch } from 'react-redux' ;
34import { Map } from 'immutable' ;
5+ import { useIntl } from 'react-intl' ;
6+ import { Link } from 'react-router-dom' ;
7+ import { ExternalLink } from '@strapi/icons' ;
48
59import {
610 deleteContentType ,
@@ -16,6 +20,7 @@ const CollectionURLs = () => {
1620 const dispatch = useDispatch ( ) ;
1721 const [ modalOpen , setModalOpen ] = useState ( false ) ;
1822 const [ uid , setUid ] = useState ( null ) ;
23+ const { formatMessage } = useIntl ( ) ;
1924 const [ langcode , setLangcode ] = useState ( 'und' ) ;
2025
2126 const handleModalSubmit = ( e ) => {
@@ -44,6 +49,33 @@ const CollectionURLs = () => {
4449 return null ;
4550 }
4651
52+ if ( state . get ( 'contentTypes' ) . size === 0 ) {
53+ return (
54+ < EmptyStateLayout
55+ content = { formatMessage ( {
56+ id : 'webtools.collection-urls.contenttypes.table.empty' ,
57+ defaultMessage : 'Before you can add collections to the sitemap, you need to enable Webtools for at least one content type.' ,
58+ } ) }
59+ action = { (
60+ < Button
61+ variant = "secondary"
62+ tag = { Link }
63+ to = "https://docs.pluginpal.io/webtools/usage"
64+ startIcon = { < ExternalLink /> }
65+ target = "_blank"
66+ >
67+ { formatMessage ( {
68+ id : 'webtools.settings.button.read_docs' ,
69+ defaultMessage : 'Learn how to enable Webtools' ,
70+ } ) }
71+ </ Button >
72+ ) }
73+ shadow = "tableShadow"
74+ hasRadius
75+ />
76+ ) ;
77+ }
78+
4779 return (
4880 < div >
4981 < List
0 commit comments