refactor: consistent component props

This commit is contained in:
2026-02-04 12:35:31 +05:00
parent aa5c55f95f
commit 2797fea079
13 changed files with 123 additions and 143 deletions
+5 -13
View File
@@ -1,27 +1,19 @@
<script lang="ts">
import TextManager from "./TextManager.svelte";
let {
texts,
onTextAdd,
onTextUpdate,
onTextDelete
}: {
interface Props {
texts: Array<{ id: string; text: string }>;
onTextAdd: (text: string) => void;
onTextUpdate: (id: string, text: string) => void;
onTextDelete: (id: string) => void;
} = $props();
}
let { texts, onTextAdd, onTextUpdate, onTextDelete }: Props = $props();
</script>
<div class="text-section">
<h2>Добавьте тексты для панелей</h2>
<TextManager
onTextAdd={onTextAdd}
onTextUpdate={onTextUpdate}
onTextDelete={onTextDelete}
texts={texts}
/>
<TextManager {onTextAdd} {onTextUpdate} {onTextDelete} {texts} />
</div>
<style>