Component created
This commit is contained in:
parent
369e03bccf
commit
0d198afe97
26
apps/photos/src/components/pages/gallery/AvatarIcon.tsx
Normal file
26
apps/photos/src/components/pages/gallery/AvatarIcon.tsx
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
interface CircleProps {
|
||||||
|
letter: string;
|
||||||
|
color: string;
|
||||||
|
size: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Circle: React.FC<CircleProps> = ({ letter, color, size }) => {
|
||||||
|
const circleStyle = {
|
||||||
|
width: `${size}px`,
|
||||||
|
height: `${size}px`,
|
||||||
|
backgroundColor: color,
|
||||||
|
borderRadius: '50%',
|
||||||
|
display: 'flex',
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
|
color: '#fff',
|
||||||
|
fontWeight: 'bold',
|
||||||
|
fontSize: `${Math.floor(size / 2)}px`,
|
||||||
|
};
|
||||||
|
|
||||||
|
return <div style={circleStyle}>{letter}</div>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Circle;
|
Loading…
Reference in a new issue