Files
codey.lol/src/components/RandomMsg.jsx

29 lines
688 B
React
Raw Normal View History

2025-06-22 09:50:36 -04:00
import { API_URL } from "../config";
import { default as $ } from "jquery";
var randomMsg;
const getRandomMsg = () => {
$.ajax({
url: API_URL+'/randmsg',
method: "POST",
contentType: "application/json; charset=utf-8"
}).done(function (data) {
if (! data.msg) {
return;
} else {
randomMsg = data.msg.replace("<br>", "\n");
$('.random-msg').html(`<small><i>${randomMsg}</i></small>`);
}
});
}
export default function RandomMsg() {
getRandomMsg();
return (
<div className="random-msg">
</div>
);
}