made anime Id in table a link to their respective sites

This commit is contained in:
2024-10-02 19:26:52 -04:00
parent 7e3369d0f0
commit 2cffd54c4d
4 changed files with 173 additions and 138 deletions

View File

@@ -1,15 +1,22 @@
<script lang="ts">
import { createTable, Render, Subscribe } from "svelte-headless-table";
import {
createRender,
createTable,
Render,
Subscribe,
} from "svelte-headless-table"
// @ts-ignore
import { addSortBy } from "svelte-headless-table/plugins";
import { tableItems } from "../helperModules/GlobalVariablesAndHelperFunctions.svelte";
import { addSortBy } from "svelte-headless-table/plugins"
import { tableItems } from "../helperModules/GlobalVariablesAndHelperFunctions.svelte"
import WebsiteLink from "./WebsiteLink.svelte"
//when adding sort here is code { sort: addSortBy() }
const table = createTable(tableItems, { sort: addSortBy() });
const table = createTable(tableItems, { sort: addSortBy() })
const columns = table.createColumns([
table.column({
header: "Service Id",
cell: ({ value }) => createRender(WebsiteLink, {id: value}),
accessor: "id",
}),
table.column({
@@ -48,11 +55,11 @@
header: "Notes",
accessor: "notes",
}),
]);
])
//add pluginStates when add sort back
const { headerRows, rows, tableAttrs, tableBodyAttrs } =
table.createViewModel(columns);
table.createViewModel(columns)
</script>
<div class="relative overflow-x-auto rounded-lg mb-5">