File size: 843 Bytes
b2ecf7d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<script lang="ts">
	import WidgetSubmitBtn from "../WidgetSubmitBtn/WidgetSubmitBtn.svelte";

	export let flatTop = false;
	export let isLoading: boolean;
	export let isDisabled = false;
	export let onClickSubmitBtn: (e?: MouseEvent) => void;
	export let placeholder = "Your sentence here...";
	export let submitButtonLabel: string | undefined = undefined;
	export let value: string = "";
</script>

<div class="flex h-10">
	<input
		bind:value
		class="form-input-alt min-w-0 flex-1 rounded-r-none {flatTop ? 'rounded-t-none' : ''}"
		placeholder={isDisabled ? "" : placeholder}
		required={true}
		type="text"
		disabled={isLoading || isDisabled}
	/>
	<WidgetSubmitBtn
		classNames="rounded-l-none border-l-0 {flatTop ? 'rounded-t-none' : ''}"
		{isLoading}
		{isDisabled}
		label={submitButtonLabel}
		onClick={onClickSubmitBtn}
	/>
</div>