feat: implement base text manager and view components

This commit is contained in:
2026-02-05 18:20:05 +05:00
parent f1f37aec9e
commit a5cea0ab57
8 changed files with 281 additions and 11 deletions
+39
View File
@@ -0,0 +1,39 @@
<script lang="ts">
import Card from "$components/layout/Card.svelte";
import InputGroup from "$components/layout/InputGroup.svelte";
import Button from "$components/ui/Button.svelte";
import IconPlus from "$components/ui/Icons/IconPlus.svelte";
import { textsState } from "$states/texts.state.svelte";
import TextInlineEdit from "./TextInlineEdit.svelte";
import TextInput from "./TextInput.svelte";
let text: string = $state("");
function addText() {
console.log(text);
text = "";
}
function deleteText(id: number) {}
</script>
<Card title="Тексты панелей">
<InputGroup>
<TextInput bind:text onenter={addText} />
<Button icon={IconPlus} onclick={addText} />
</InputGroup>
<div class="texts-list">
{#each textsState.texts as { text, id } (id)}
<TextInlineEdit {text} ondelete={() => deleteText(id)} />
{/each}
</div>
</Card>
<style>
/* Texts List */
.texts-list {
display: flex;
flex-direction: column;
gap: 8px;
}
</style>