mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-05 08:53:14 +00:00
18 lines
385 B
JavaScript
18 lines
385 B
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { useMetadata } from '../hooks';
|
|
|
|
const MetadataViewName = ({ id }) => {
|
|
const { viewsMap } = useMetadata();
|
|
if (!id) return null;
|
|
const view = viewsMap[id];
|
|
if (!view) return null;
|
|
return (<>{view.name}</>);
|
|
};
|
|
|
|
MetadataViewName.propTypes = {
|
|
id: PropTypes.string,
|
|
};
|
|
|
|
export default MetadataViewName;
|