2023-06-07 15:26:00 +00:00
|
|
|
import { Label } from 'semantic-ui-react';
|
|
|
|
|
2023-05-16 13:33:59 +00:00
|
|
|
export function renderText(text, limit) {
|
|
|
|
if (text.length > limit) {
|
|
|
|
return text.slice(0, limit - 3) + '...';
|
|
|
|
}
|
|
|
|
return text;
|
2023-06-07 15:26:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export function renderGroup(group) {
|
|
|
|
if (group === "") {
|
|
|
|
return <Label>default</Label>
|
|
|
|
}
|
2023-06-14 04:52:56 +00:00
|
|
|
let groups = group.split(",");
|
|
|
|
groups.sort();
|
|
|
|
return <>
|
|
|
|
{groups.map((group) => {
|
|
|
|
if (group === "vip" || group === "pro") {
|
|
|
|
return <Label color='yellow'>{group}</Label>
|
|
|
|
} else if (group === "svip" || group === "premium") {
|
|
|
|
return <Label color='red'>{group}</Label>
|
|
|
|
}
|
|
|
|
return <Label>{group}</Label>
|
|
|
|
})}
|
|
|
|
</>
|
2023-05-16 13:33:59 +00:00
|
|
|
}
|