mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-14 14:21:23 +00:00
18 lines
393 B
JavaScript
18 lines
393 B
JavaScript
![]() |
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;
|