#591 - notification-channels

This commit is contained in:
Saeed Vaziry
2025-05-19 20:05:38 +02:00
parent 563b9c5909
commit cdc012c270
16 changed files with 611 additions and 100 deletions

View File

@ -66,7 +66,7 @@ export default function ConnectStorageProvider({
return (
<Dialog open={open} onOpenChange={setOpen}>
<DialogTrigger asChild>{children}</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-xl">
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-2xl">
<DialogHeader>
<DialogTitle>Connect to storage provider</DialogTitle>
<DialogDescription className="sr-only">Connect to a new storage provider</DialogDescription>
@ -109,21 +109,27 @@ export default function ConnectStorageProvider({
/>
<InputError message={form.errors.name} />
</FormField>
{page.props.configs.storage_providers_custom_fields[form.data.provider]?.map((item: string) => (
<FormField key={item}>
<Label htmlFor={item} className="capitalize">
{item.replaceAll('_', ' ')}
</Label>
<Input
type="text"
name={item}
id={item}
value={(form.data[item as keyof StorageProviderForm] as string) ?? ''}
onChange={(e) => form.setData(item as keyof StorageProviderForm, e.target.value)}
/>
<InputError message={form.errors[item as keyof StorageProviderForm]} />
</FormField>
))}
<div
className={
page.props.configs.storage_providers_custom_fields[form.data.provider].length > 1 ? 'grid grid-cols-2 items-start gap-6' : ''
}
>
{page.props.configs.storage_providers_custom_fields[form.data.provider]?.map((item: string) => (
<FormField key={item}>
<Label htmlFor={item} className="capitalize">
{item.replaceAll('_', ' ')}
</Label>
<Input
type="text"
name={item}
id={item}
value={(form.data[item as keyof StorageProviderForm] as string) ?? ''}
onChange={(e) => form.setData(item as keyof StorageProviderForm, e.target.value)}
/>
<InputError message={form.errors[item as keyof StorageProviderForm]} />
</FormField>
))}
</div>
<FormField>
<div className="flex items-center space-x-3">
<Checkbox id="global" name="global" checked={form.data.global} onClick={() => form.setData('global', !form.data.global)} />