PSFPortal/app/components/CharacterLink.svelte

26 lines
571 B
Svelte
Raw Normal View History

2019-12-30 14:27:49 +00:00
<script>
import { isAdmin } from '../UserState'
export let character;
</script>
<style>
</style>
2019-12-30 14:27:49 +00:00
<span class="character-link">
<span class="faction-icon">
2019-12-30 14:27:49 +00:00
{#if character.faction_id == 1}
<img height=32 src="/img/nc_icon.png" alt="NC" />
2019-12-30 14:27:49 +00:00
{:else if character.faction_id == 0}
<img height=32 src="/img/tr_icon.png" alt="TR" />
{:else if character.faction_id == 2}
<img height=32 src="/img/vs_icon.png" alt="VS" />
{/if}
</span>
2019-12-30 14:27:49 +00:00
{#if $isAdmin}
2019-12-30 18:20:50 +00:00
<a href="/user/{character.account_id}">{character.name}</a>
2019-12-30 14:27:49 +00:00
{:else}
<span>{character.name}</span>
{/if}
</span>