Updated code after code review

This commit is contained in:
Christian Sarnataro
2023-01-09 23:49:52 +01:00
parent 2364f267cf
commit c7ac31bb99
3 changed files with 26 additions and 70 deletions

View File

@@ -2,33 +2,16 @@ import PropTypes from 'prop-types';
import { skeleton } from '../../helpers/utils';
const DefaultFooter = () => {
return (
<a
href="https://github.com/arifszn/gitprofile"
target="_blank"
rel="noreferrer"
>
<div>
<p className="font-mono text-sm">
Made with <span className="text-primary">GitProfile</span> and
</p>
</div>
</a>
);
};
const Footer = ({ content, loading }) => {
let footerContent = null;
if (content) {
footerContent = <div dangerouslySetInnerHTML={{ __html: content }} />;
} else {
footerContent = <DefaultFooter />;
}
if (!content) return null;
return (
<div className="card-body">
{loading ? skeleton({ width: 'w-52', height: 'h-6' }) : footerContent}
{loading ? (
skeleton({ width: 'w-52', height: 'h-6' })
) : (
<div dangerouslySetInnerHTML={{ __html: content }} />
)}
</div>
);
};