supMDX/components/MetaInfo.tsx
2022-11-04 21:47:43 +09:00

12 lines
349 B
TypeScript

import config from '#config';
export default function MetaInfo({data}: {data: {[_: string]: any}}) {
const {metaFields: fields = []} = config;
return <div>{fields.map(({label, prop}) => {
const val = data[prop];
return val == null ? null : <div key={prop}>
<span>{label}</span>
<span>{val}</span>
</div>;
})}</div>;
}