22 lines
763 B
JavaScript
22 lines
763 B
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
import React from 'react';
|
|
import Draft from '@theme/ContentVisibility/Draft';
|
|
import Unlisted from '@theme/ContentVisibility/Unlisted';
|
|
export default function ContentVisibility({metadata}) {
|
|
const {unlisted, frontMatter} = metadata;
|
|
// Reading draft/unlisted status from frontMatter is useful to display
|
|
// the banners in dev mode (in dev, metadata.unlisted is always false)
|
|
// See https://github.com/facebook/docusaurus/issues/8285
|
|
return (
|
|
<>
|
|
{(unlisted || frontMatter.unlisted) && <Unlisted />}
|
|
{frontMatter.draft && <Draft />}
|
|
</>
|
|
);
|
|
}
|