File tree Expand file tree Collapse file tree
routes/(authenticated)/admin/blacklists Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 import type { FullAutoFill } from ' svelte/elements' ;
88
99 interface Props {
10- label: string ;
10+ label? : string ;
1111 placeholder? : string ;
1212 autocomplete? : FullAutoFill ;
1313 value: string ;
Original file line number Diff line number Diff line change 1414 import { Separator } from ' $lib/components/ui/separator' ;
1515 import { handleApiError } from ' $lib/errorhandling/apiErrorHandling' ;
1616 import type { TimeoutHandle } from ' $lib/types/WAPI' ;
17+ import EmailInput from ' $lib/components/input/EmailInput.svelte' ;
1718
1819 // --- state ---
1920 let usernameEntry = $state <string >(' ' );
2223 let isLoadingUsernames = $state (false );
2324
2425 let emailEntry = $state <string >(' ' );
26+ let emailEntryValid = $state (false );
2527 let emailBlacklist = $state <EmailProviderBlacklistDto []>([]);
2628 let isLoadingEmails = $state (false );
2729
142144 loadEmails (' ' );
143145 return ;
144146 }
147+
148+ if (! emailEntryValid ) return ;
145149
146150 emailDebounce = setTimeout (() => loadEmails (emailEntry ), 400 );
147151 });
199203 <Card >
200204 <CardHeader >
201205 <CardTitle >Email-Provider Blacklist</CardTitle >
202- <TextInput placeholder ="e.g. gmail.com" bind:value ={emailEntry }>
206+ <EmailInput placeholder ="e.g. gmail.com" bind:value ={emailEntry } bind:valid ={ emailEntryValid }>
203207 {#snippet after ()}
204208 <Button onclick ={addEmailEntry } disabled ={isLoadingEmails }>Add</Button >
205209 <Button onclick ={addEmailsBatch } disabled ={isLoadingEmails }
206210 >Batch Upload From Clipboard</Button
207211 >
208212 {/ snippet }
209- </TextInput >
213+ </EmailInput >
210214 </CardHeader >
211215 <CardContent >
212216 <ScrollArea class =" max-h-64" >
You can’t perform that action at this time.
0 commit comments