15 lines
		
	
	
		
			347 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			347 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { asset } from "$fresh/runtime.ts";
 | |
| 
 | |
| export const Emoji = (props: { class?: string; name: string }) => {
 | |
|   return props.name
 | |
|     ? props.name.endsWith(".png")
 | |
|       ? (
 | |
|         <img
 | |
|           class={`${props?.class || ""}`}
 | |
|           src={asset(`/emojis/${props.name}`)}
 | |
|         />
 | |
|       )
 | |
|       : <span>{props.name}</span>
 | |
|     : <></>;
 | |
| };
 |