mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-29 14:46:38 +08:00
32 lines
681 B
JavaScript
32 lines
681 B
JavaScript
import PropTypes from 'prop-types';
|
|
import { forwardRef } from 'react';
|
|
|
|
import Box from '@mui/material/Box';
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
const SvgColor = forwardRef(({ src, sx, ...other }, ref) => (
|
|
<Box
|
|
component="span"
|
|
className="svg-color"
|
|
ref={ref}
|
|
sx={{
|
|
width: 24,
|
|
height: 24,
|
|
display: 'inline-block',
|
|
bgcolor: 'currentColor',
|
|
mask: `url(${src}) no-repeat center / contain`,
|
|
WebkitMask: `url(${src}) no-repeat center / contain`,
|
|
...sx
|
|
}}
|
|
{...other}
|
|
/>
|
|
));
|
|
|
|
SvgColor.propTypes = {
|
|
src: PropTypes.string,
|
|
sx: PropTypes.object
|
|
};
|
|
|
|
export default SvgColor;
|