<script lang="ts">
	import type { ComponentProps } from "svelte";
	import Item from "./Item.svelte";
	import type { App, TFile } from "obsidian";
	import FileSuggest from "../suggesters/FileSuggest.svelte";

	type Props = Omit<ComponentProps<typeof Item>, "control"> & {
		app: App;
		id: string;
		value?: string;
	};

	let { name, description, app, id, value = $bindable() }: Props = $props();
</script>

<Item {name} {description}>
	{#snippet control()}
		<FileSuggest {id} {app} asString bind:value />
	{/snippet}
</Item>
