forked from abner/for-legacy-web
Show tooltip for long statuses.
This commit is contained in:
@@ -2,15 +2,25 @@ import { User } from "revolt.js";
|
||||
import { Users } from "revolt.js/dist/api/objects";
|
||||
|
||||
import { Text } from "preact-i18n";
|
||||
import Tooltip from "../Tooltip";
|
||||
|
||||
interface Props {
|
||||
user: User;
|
||||
tooltip?: boolean;
|
||||
}
|
||||
|
||||
export default function UserStatus({ user }: Props) {
|
||||
export default function UserStatus({ user, tooltip }: Props) {
|
||||
if (user.online) {
|
||||
if (user.status?.text) {
|
||||
return <>{user.status?.text}</>;
|
||||
if (tooltip) {
|
||||
return (
|
||||
<Tooltip arrow={undefined} content={ user.status.text }>
|
||||
{ user.status.text }
|
||||
</Tooltip>
|
||||
)
|
||||
}
|
||||
|
||||
return <>{user.status.text}</>;
|
||||
}
|
||||
|
||||
if (user.status?.presence === Users.Presence.Busy) {
|
||||
|
||||
Reference in New Issue
Block a user