| 16 | const { t } = await import("../popup/helpers/lang.js"); |
| 17 | |
| 18 | function renderUser(user, index) { |
| 19 | //prettier-ignore |
| 20 | let { pk, username, full_name, is_private, is_verified, pk_id, profile_pic_url, friendship_status, social_context } = user; |
| 21 | //prettier-ignore |
| 22 | const {following, incoming_request, outgoing_request, is_bestie, is_restricted, is_feed_favorite} = friendship_status; |
| 23 | |
| 24 | return /*html*/ `<tr> |
| 25 | <td>${index}</td> |
| 26 | <td> |
| 27 | <a href="${profile_pic_url}" target="_blank"> |
| 28 | <img src="${profile_pic_url}" crossorigin="anonymous"> |
| 29 | </a> |
| 30 | </td> |
| 31 | <td>${username}<br/><span>${full_name}</span></td> |
| 32 | <td>${pk_id}<br/>${pk !== pk_id ? pk : ""}</td> |
| 33 | <td> |
| 34 | <span>${ |
| 35 | following |
| 36 | ? "Đang follow" |
| 37 | : incoming_request |
| 38 | ? "Đang muốn kết bạn" |
| 39 | : outgoing_request |
| 40 | ? "Chờ chấp nhận kết bạn" |
| 41 | : is_bestie |
| 42 | ? "Bạn thân" |
| 43 | : is_restricted |
| 44 | ? "Đang giảm tương tác" |
| 45 | : is_feed_favorite |
| 46 | ? "Yêu thích" |
| 47 | : "" |
| 48 | }<span> |
| 49 | </td> |
| 50 | <td><span>${social_context || ""}<span></td> |
| 51 | </tr> |
| 52 | `; |
| 53 | } |
| 54 | |
| 55 | let txt = prompt( |
| 56 | t({ |