Futa Arai 2 лет назад
Родитель
Сommit
4fb496e6a6

+ 5 - 10
packages/remark-attachment-refs/src/client/components/AttachmentList.tsx

@@ -25,20 +25,15 @@ export const AttachmentList = ({
   attachments,
 }: Props): JSX.Element => {
   const renderNoAttachmentsMessage = useCallback(() => {
-    let message;
-
-    if (refsContext.options?.prefix != null) {
-      message = `${refsContext.options.prefix} and descendant pages have no attachments`;
-    }
-    else {
-      message = `${refsContext.pagePath} has no attachments`;
-    }
-
     return (
       <div className="text-muted">
         <small>
           <i className="fa fa-fw fa-info-circle" aria-hidden="true"></i>
-          {message}
+          {
+            refsContext.options?.prefix != null
+              ? `${refsContext.options.prefix} and descendant pages have no attachments`
+              : `${refsContext.pagePath} has no attachments`
+          }
         </small>
       </div>
     );