1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-14 14:21:23 +00:00

refactor(metadata): update code structure (#6765)

This commit is contained in:
Jerry Ren
2024-09-14 16:31:32 +08:00
committed by GitHub
parent 7f56426ad8
commit e3c0dcfffc
338 changed files with 751 additions and 1243 deletions

View File

@@ -0,0 +1,30 @@
import React, { useCallback } from 'react';
import PropTypes from 'prop-types';
import Editor from '../../cell-editors/rate-editor';
import { gettext } from '../../../../utils/constants';
import './index.css';
const RateEditor = ({ value, field, onChange: onChangeAPI }) => {
const onChange = useCallback((update) => {
onChangeAPI(update[field.key]);
}, [field, onChangeAPI]);
return (
<div
className="sf-metadata-property-detail-editor sf-metadata-rate-property-detail-editor"
placeholder={gettext('Empty')}
>
<Editor isCellSelected={true} field={field} value={value} onChange={onChange} />
</div>
);
};
RateEditor.propTypes = {
value: PropTypes.number,
field: PropTypes.object,
onChange: PropTypes.func,
};
export default RateEditor;