1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-14 14:21:23 +00:00
Files
seahub/frontend/src/metadata/metadata-view-id-2-name.js

18 lines
393 B
JavaScript
Raw Normal View History

import React from 'react';
import PropTypes from 'prop-types';
import { useMetadata } from './hooks';
const MetadataViewId2Name = ({ id }) => {
const { viewsMap } = useMetadata();
if (!id) return null;
const view = viewsMap[id];
if (!view) return null;
return (<>{view.name}</>);
};
MetadataViewId2Name.propTypes = {
id: PropTypes.string,
};
export default MetadataViewId2Name;