snort/src/element/ProfilePreview.js

23 lines
656 B
JavaScript
Raw Normal View History

2023-01-01 19:57:27 +00:00
import "./ProfilePreview.css";
import ProfileImage from "./ProfileImage";
import FollowButton from "./FollowButton";
2023-01-10 10:30:33 +00:00
import useProfile from "../feed/ProfileFeed";
2023-01-01 19:57:27 +00:00
export default function ProfilePreview(props) {
const pubkey = props.pubkey;
2023-01-10 10:30:33 +00:00
const user = useProfile(pubkey);
const options = {
about: true,
...props.options
};
2023-01-01 19:57:27 +00:00
return (
<div className="profile-preview">
2023-01-10 10:30:33 +00:00
<ProfileImage pubkey={pubkey} />
{options.about ? <div className="f-ellipsis">
2023-01-01 19:57:27 +00:00
{user?.about}
2023-01-10 10:30:33 +00:00
</div> : null}
<FollowButton pubkey={pubkey} className="ml5" />
2023-01-01 19:57:27 +00:00
</div>
)
}