open-nomad/ui/app/components/tooltip.js

17 lines
417 B
JavaScript
Raw Normal View History

2021-10-21 17:12:33 +00:00
import Component from '@glimmer/component';
export default class Tooltip extends Component {
get text() {
const inputText = this.args.text;
if (!inputText || inputText.length < 30) {
return inputText;
}
const prefix = inputText.substr(0, 15).trim();
2021-12-28 16:08:12 +00:00
const suffix = inputText
.substr(inputText.length - 10, inputText.length)
.trim();
2021-10-21 17:12:33 +00:00
return `${prefix}...${suffix}`;
}
}