UI is not modified much besides removing the border-bottom, and using only message body. However instead of having a fix template, this is all automatically generated and random, resulting in a more natural experience.
17 lines
494 B
JavaScript
17 lines
494 B
JavaScript
import Component from "@glimmer/component";
|
|
import { htmlSafe } from "@ember/template";
|
|
|
|
export default class ChatSkeleton extends Component {
|
|
get placeholders() {
|
|
return Array.from({ length: 15 }, () => {
|
|
return Array.from({ length: this.#randomIntFromInterval(1, 5) }, () => {
|
|
return htmlSafe(`width: ${this.#randomIntFromInterval(20, 95)}%`);
|
|
});
|
|
});
|
|
}
|
|
|
|
#randomIntFromInterval(min, max) {
|
|
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
}
|
|
}
|