use crate::{show_pointer, ProfilePreview};
use egui::Sense;
use enostr::Pubkey;
use nostrdb::{Ndb, Transaction};
use notedeck::{name::get_display_name, Images, NoteAction};
pub struct Mention<'a> {
ndb: &'a Ndb,
img_cache: &'a mut Images,
txn: &'a Transaction,
pk: &'a [u8; 32],
selectable: bool,
size: f32,
}
impl<'a> Mention<'a> {
pub fn new(
ndb: &'a Ndb,
img_cache: &'a mut Images,
txn: &'a Transaction,
pk: &'a [u8; 32],
) -> Self {
let size = 16.0;
let selectable = true;
Mention {
ndb,
img_cache,
txn,
pk,
selectable,
size,
}
}
pub fn selectable(mut self, selectable: bool) -> Self {
self.selectable = selectable;
self
}
pub fn size(mut self, size: f32) -> Self {
self.size = size;
self
}
pub fn show(self, ui: &mut egui::Ui) -> egui::InnerResponse