How should I show the comments' photo and the message without the link?

import React from ‘react’;

export const Comment = ({user,message}) =>
{
const getPhoto = (message) => {
let regex = /^https?://./..(png|gif|webp|jpeg|jpg)??.*$/gmi;
let result;
if (message.match(regex)){
result = {
match: message.match(regex)
}
} else {
result = false;
}
console.log(result);
return result;
}

const linkPhoto = getPhoto(message);
console.log(linkPhoto);

const getMessage = (message, urlPhoto) => 
{
    if(urlPhoto === false)
    {
        return message;
    }
    else
    {
        message = message.replace(urlPhoto,"");
        return message;
    }
}

const comment = getMessage(message, linkPhoto);

return(
<div style={{flexWrap:"wrap", width:"70%"}}>
    <p><strong>{user}</strong>:{comment}</p>
    <img src={linkPhoto} width="100" height="100" alt="comment photo"/>
</div>
)

}