diff --git a/frontend/src/components/dirent-detail/detail-item/index.css b/frontend/src/components/dirent-detail/detail-item/index.css new file mode 100644 index 00000000000..95e67b54b98 --- /dev/null +++ b/frontend/src/components/dirent-detail/detail-item/index.css @@ -0,0 +1,51 @@ +.dirent-detail-item { + width: 100%; + display: flex; + justify-content: space-between; + margin-bottom: 4px; + font-size: 14px; +} + +.dirent-detail-item .dirent-detail-item-name-container { + width: 160px; + padding: 7px 6px; + min-height: 34px; + height: fit-content; + color: #666; + font-size: 14px; + line-height: 1.4; +} + +.dirent-detail-item .dirent-detail-item-name-container .sf-metadata-icon { + margin-right: 6px; + font-size: 14px; + fill: #999; +} + +.dirent-detail-item .dirent-detail-item-value { + width: 200px; + display: flex; + padding: 7px 6px; + min-height: 34px; + height: fit-content; +} + +.dirent-detail-item .dirent-detail-item-value.editable:hover { + cursor: pointer; +} + +.dirent-detail-item .dirent-detail-item-name-container:hover, +.dirent-detail-item .dirent-detail-item-value:hover { + background-color: #F5F5F5; + border-radius: 3px; + cursor: default; +} + +.dirent-detail-item .dirent-detail-item-value .text-formatter, +.dirent-detail-item .dirent-detail-item-value .ctime-formatter { + line-height: 1.5; +} + +.dirent-detail-item-value .creator-formatter { + height: 20px; +} diff --git a/frontend/src/components/dirent-detail/detail-item/index.js b/frontend/src/components/dirent-detail/detail-item/index.js new file mode 100644 index 00000000000..de51d5c7c30 --- /dev/null +++ b/frontend/src/components/dirent-detail/detail-item/index.js @@ -0,0 +1,36 @@ +import React, { useMemo } from 'react'; +import PropTypes from 'prop-types'; +import { Formatter, Icon } from '@seafile/sf-metadata-ui-component'; +import classnames from 'classnames'; +import { CellType, COLUMNS_ICON_CONFIG } from '../../../metadata/metadata-view/_basic'; + +import './index.css'; + +const DetailItem = ({ field, value, valueId, valueClick, children, ...params }) => { + const icon = useMemo(() => { + if (field.type === 'size') return COLUMNS_ICON_CONFIG[CellType.NUMBER]; + return COLUMNS_ICON_CONFIG[field.type]; + }, [field]); + + return ( +
{gettext('Files')} | {this.state.fileCount} |
---|---|
{gettext('Size')} | {repo.size} |
{gettext('Last Update')} | { moment(repo.last_modified).fromNow()} |