diff --git a/Client/src/Components/Avatar/index.jsx b/Client/src/Components/Avatar/index.jsx index 99a6c1542..151914061 100644 --- a/Client/src/Components/Avatar/index.jsx +++ b/Client/src/Components/Avatar/index.jsx @@ -2,7 +2,6 @@ import { Avatar as MuiAvatar } from "@mui/material"; import PropTypes from "prop-types"; import { useSelector } from "react-redux"; import { useEffect, useState } from "react"; -import { bufferTo64, bufferToUrl } from "../../Utils/fileUtils"; /** * @component @@ -32,7 +31,6 @@ const Avatar = ({ src, small, sx }) => { return ( { ...style, ...sx, }} - /> + > + {user.firstname?.charAt(0)}{user.lastname?.charAt(0)} + ); }; diff --git a/Client/src/Utils/fileUtils.js b/Client/src/Utils/fileUtils.js index 7e33ba6b1..699832b47 100644 --- a/Client/src/Utils/fileUtils.js +++ b/Client/src/Utils/fileUtils.js @@ -8,24 +8,4 @@ export const checkImage = (url) => { const img = new Image(); img.src = url; return img.naturalWidth !== 0; -}; - -export const bufferTo64 = (bufferData) => { - const uint8Array = new Uint8Array(bufferData.data); - const blob = new Blob([uint8Array], { type: bufferData.contentType }); - return new Promise((resolve) => { - const reader = new FileReader(); - reader.onloadend = () => { - resolve(reader.result); - }; - reader.readAsDataURL(blob); - }); -}; - -export const bufferToUrl = (buffer) => { - console.log(buffer); - const blob = new Blob([buffer.data], { type: buffer.contentType }); - const url = URL.createObjectURL(blob); - - return url; -}; +}; \ No newline at end of file