added shadcn and started PROJECT.md for tracking
This commit is contained in:
28
src/lib/components/data-table-target.svelte
Normal file
28
src/lib/components/data-table-target.svelte
Normal file
@@ -0,0 +1,28 @@
|
||||
<script lang="ts">
|
||||
import { toast } from "svelte-sonner";
|
||||
import { Input } from "#lib/components/ui/input/index.js";
|
||||
import { Label } from "#lib/components/ui/label/index.js";
|
||||
import type { DashboardTableFeatures } from "./data-table-features.js";
|
||||
import type { Schema } from "./schemas.js";
|
||||
import type { Row } from "@tanstack/svelte-table";
|
||||
|
||||
let { row }: { row: Row<DashboardTableFeatures, Schema> } = $props();
|
||||
</script>
|
||||
|
||||
<form
|
||||
onsubmit={(e) => {
|
||||
e.preventDefault();
|
||||
toast.promise(new Promise((resolve) => setTimeout(resolve, 1000)), {
|
||||
loading: `Saving ${row.original.header}`,
|
||||
success: "Done",
|
||||
error: "Error",
|
||||
});
|
||||
}}
|
||||
>
|
||||
<Label for="{row.original.id}-target" class="sr-only">Target</Label>
|
||||
<Input
|
||||
class="h-8 w-16 border-transparent bg-transparent text-end shadow-none hover:bg-input/30 focus-visible:border focus-visible:bg-background dark:bg-transparent dark:hover:bg-input/30 dark:focus-visible:bg-input/30"
|
||||
value={row.original.target}
|
||||
id="{row.original.id}-target"
|
||||
/>
|
||||
</form>
|
||||
Reference in New Issue
Block a user