Plan stuff. Log stuff.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

30 lines
830 B

<script>
import { createEventDispatcher } from 'svelte';
import Link from "../Link.svelte";
import Table from "../Table.svelte";
export let items = [];
const dispatch = createEventDispatcher();
function onOption(name, id) {
const item = items.find(i => i.id === id)
dispatch("option", {name, item})
}
</script>
<Table headers={["Name", "Multiplier", "Options"]} percentages={[60, 5, 35]}>
{#each items as item (item.id)}
<tr>
<td class="ellipsis">{item.name}</td>
<td>{item.multiplier.toFixed(2)}</td>
<td>
<Link on:click={() => onOption("item.stats", item.id)}>Stats</Link>,
<Link on:click={() => onOption("item.edit", item.id)}>Edit</Link>,
<Link on:click={() => onOption("item.remove", item.id)}>Delete</Link>
</td>
</tr>
{/each}
</Table>