| 
									
										
										
										
											2018-05-01 17:05:36 -07:00
										 |  |  | <SearchResult href="/accounts/{account.id}"> | 
					
						
							| 
									
										
										
										
											2018-02-06 20:54:49 -08:00
										 |  |  |   <div class="search-result-account"> | 
					
						
							| 
									
										
										
										
											2018-08-23 19:40:03 -07:00
										 |  |  |     <div class="search-result-account-avatar"> | 
					
						
							|  |  |  |       <Avatar {account} size="small" /> | 
					
						
							|  |  |  |     </div> | 
					
						
							| 
									
										
										
										
											2018-02-06 20:54:49 -08:00
										 |  |  |     <div class="search-result-account-name"> | 
					
						
							| 
									
										
										
										
											2018-08-19 15:23:40 -07:00
										 |  |  |       <AccountDisplayName {account} /> | 
					
						
							| 
									
										
										
										
											2018-02-06 20:54:49 -08:00
										 |  |  |     </div> | 
					
						
							|  |  |  |     <div class="search-result-account-username"> | 
					
						
							| 
									
										
										
										
											2018-05-01 17:05:36 -07:00
										 |  |  |       {'@' + account.acct} | 
					
						
							| 
									
										
										
										
											2018-02-06 20:54:49 -08:00
										 |  |  |     </div> | 
					
						
							| 
									
										
										
										
											2018-05-01 17:05:36 -07:00
										 |  |  |     {#if actions && actions.length} | 
					
						
							| 
									
										
										
										
											2018-04-28 14:19:39 -07:00
										 |  |  |       <div class="search-result-account-buttons"> | 
					
						
							| 
									
										
										
										
											2018-05-01 17:05:36 -07:00
										 |  |  |         {#each actions as action} | 
					
						
							| 
									
										
										
										
											2018-04-28 14:19:39 -07:00
										 |  |  |           <IconButton | 
					
						
							| 
									
										
										
										
											2018-05-01 17:05:36 -07:00
										 |  |  |             label={action.label} | 
					
						
							| 
									
										
										
										
											2018-04-28 14:19:39 -07:00
										 |  |  |             on:click="onButtonClick(event, action, account.id)" | 
					
						
							| 
									
										
										
										
											2018-05-01 17:05:36 -07:00
										 |  |  |             href={action.icon} | 
					
						
							| 
									
										
										
										
											2018-04-28 14:19:39 -07:00
										 |  |  |             big="true" | 
					
						
							|  |  |  |           /> | 
					
						
							| 
									
										
										
										
											2018-05-01 17:05:36 -07:00
										 |  |  |         {/each} | 
					
						
							| 
									
										
										
										
											2018-04-28 14:19:39 -07:00
										 |  |  |       </div> | 
					
						
							| 
									
										
										
										
											2018-05-01 17:05:36 -07:00
										 |  |  |     {/if} | 
					
						
							| 
									
										
										
										
											2018-02-06 20:54:49 -08:00
										 |  |  |   </div> | 
					
						
							|  |  |  | </SearchResult> | 
					
						
							|  |  |  | <style> | 
					
						
							|  |  |  |   .search-result-account { | 
					
						
							|  |  |  |     display: grid; | 
					
						
							|  |  |  |     grid-template-areas: | 
					
						
							| 
									
										
										
										
											2018-04-28 14:19:39 -07:00
										 |  |  |       "avatar    name     buttons" | 
					
						
							|  |  |  |       "avatar    username buttons"; | 
					
						
							| 
									
										
										
										
											2018-02-06 20:54:49 -08:00
										 |  |  |     grid-column-gap: 20px; | 
					
						
							| 
									
										
										
										
											2018-04-28 14:19:39 -07:00
										 |  |  |     grid-template-columns: max-content 1fr max-content; | 
					
						
							| 
									
										
										
										
											2018-02-06 20:54:49 -08:00
										 |  |  |     align-items: center; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   :global(.search-result-account-avatar) { | 
					
						
							|  |  |  |     grid-area: avatar; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   .search-result-account-name { | 
					
						
							|  |  |  |     grid-area: name; | 
					
						
							|  |  |  |     white-space: nowrap; | 
					
						
							|  |  |  |     overflow: hidden; | 
					
						
							|  |  |  |     text-overflow: ellipsis; | 
					
						
							|  |  |  |     font-size: 1.2em; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   .search-result-account-username { | 
					
						
							|  |  |  |     grid-area: username; | 
					
						
							|  |  |  |     white-space: nowrap; | 
					
						
							|  |  |  |     overflow: hidden; | 
					
						
							|  |  |  |     text-overflow: ellipsis; | 
					
						
							|  |  |  |     color: var(--deemphasized-text-color); | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2018-04-28 14:19:39 -07:00
										 |  |  |   .search-result-account-buttons { | 
					
						
							|  |  |  |     grid-area: buttons; | 
					
						
							|  |  |  |     display: flex; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   :global(.search-result-account-buttons .icon-button) { | 
					
						
							|  |  |  |     margin-right: 20px; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   :global(.search-result-account-buttons .icon-button:last-child) { | 
					
						
							|  |  |  |     margin-right: 0; | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2018-02-06 21:20:33 -08:00
										 |  |  |   @media (max-width: 767px) { | 
					
						
							|  |  |  |     .search-result-account { | 
					
						
							|  |  |  |       grid-column-gap: 10px; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2018-04-28 14:19:39 -07:00
										 |  |  |     :global(.search-result-account-buttons .icon-button) { | 
					
						
							|  |  |  |       margin-right: 10px; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2018-02-06 21:20:33 -08:00
										 |  |  |   } | 
					
						
							| 
									
										
										
										
											2018-02-06 20:54:49 -08:00
										 |  |  | </style> | 
					
						
							|  |  |  | <script> | 
					
						
							| 
									
										
										
										
											2018-02-08 17:56:20 -08:00
										 |  |  |   import Avatar from '../Avatar.html' | 
					
						
							| 
									
										
										
										
											2018-02-06 20:54:49 -08:00
										 |  |  |   import SearchResult from './SearchResult.html' | 
					
						
							| 
									
										
										
										
											2018-04-28 14:19:39 -07:00
										 |  |  |   import IconButton from '../IconButton.html' | 
					
						
							| 
									
										
										
										
											2018-08-19 15:23:40 -07:00
										 |  |  |   import AccountDisplayName from '../profile/AccountDisplayName.html' | 
					
						
							| 
									
										
										
										
											2018-04-28 14:19:39 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 20:54:49 -08:00
										 |  |  |   export default { | 
					
						
							| 
									
										
										
										
											2018-04-30 09:57:49 -07:00
										 |  |  |     data: () => ({ | 
					
						
							|  |  |  |       actions: void 0 | 
					
						
							|  |  |  |     }), | 
					
						
							| 
									
										
										
										
											2018-04-28 14:19:39 -07:00
										 |  |  |     methods: { | 
					
						
							|  |  |  |       onButtonClick (event, action, accountId) { | 
					
						
							|  |  |  |         event.preventDefault() | 
					
						
							|  |  |  |         event.stopPropagation() | 
					
						
							|  |  |  |         this.fire('click', { | 
					
						
							|  |  |  |           action, | 
					
						
							|  |  |  |           accountId | 
					
						
							|  |  |  |         }) | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2018-04-30 09:57:49 -07:00
										 |  |  |     }, | 
					
						
							|  |  |  |     components: { | 
					
						
							|  |  |  |       Avatar, | 
					
						
							|  |  |  |       SearchResult, | 
					
						
							| 
									
										
										
										
											2018-08-19 15:23:40 -07:00
										 |  |  |       IconButton, | 
					
						
							|  |  |  |       AccountDisplayName | 
					
						
							| 
									
										
										
										
											2018-02-06 20:54:49 -08:00
										 |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | </script> |