supMDX/components/MetaInfo.tsx

13 lines
349 B
TypeScript
Raw Normal View History

2022-11-04 21:44:29 +09:00
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>;
}