u
This commit is contained in:
@@ -1,37 +1,10 @@
|
||||
import { Component } from 'react';
|
||||
import Box from '@mui/material/Box';
|
||||
import Typography from '@mui/material/Typography';
|
||||
|
||||
function PanelValue({ label, children }) {
|
||||
if (children == null || children === '') return null;
|
||||
return (
|
||||
<Box sx={{ mb: 1 }}>
|
||||
{label ? (
|
||||
<Typography variant="caption" color="text.secondary" display="block">
|
||||
{label}
|
||||
</Typography>
|
||||
) : null}
|
||||
<Typography variant="body2" component="div">
|
||||
{children}
|
||||
</Typography>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
function PanelHtmlValue({ label, html }) {
|
||||
function PanelHtmlValue({ html }) {
|
||||
if (html == null || html === '') return null;
|
||||
return (
|
||||
<Box sx={{ mb: 1.5 }}>
|
||||
{label ? (
|
||||
<Typography
|
||||
variant="caption"
|
||||
color="text.secondary"
|
||||
display="block"
|
||||
sx={{ mb: 0.5, fontWeight: 500 }}
|
||||
>
|
||||
{label}
|
||||
</Typography>
|
||||
) : null}
|
||||
<Box
|
||||
sx={(theme) => ({
|
||||
p: 1.5,
|
||||
@@ -83,14 +56,7 @@ function PanelHtmlValue({ label, html }) {
|
||||
export default class ArticleSeoTab extends Component {
|
||||
render() {
|
||||
const { article: articleData } = this.props;
|
||||
const seo = articleData.seo ?? articleData.seoDescription;
|
||||
const desc = articleData.desc ?? articleData.description;
|
||||
return (
|
||||
<>
|
||||
<PanelValue label="Slug">{articleData.slug}</PanelValue>
|
||||
<PanelValue label="SEO">{seo}</PanelValue>
|
||||
<PanelHtmlValue label="Beschreibung" html={desc} />
|
||||
</>
|
||||
);
|
||||
return <PanelHtmlValue html={desc} />;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user