courrier multi account restore compose

This commit is contained in:
alma 2025-04-27 22:14:08 +02:00
parent 5ac1d6e760
commit d9ebe3d6fd

View File

@ -682,8 +682,8 @@ export default function CourrierPage() {
<div className="mt-1">
{/* Form for adding a new account */}
{showAddAccountForm && (
<div className="mb-3 p-2 border border-gray-200 rounded-md bg-gray-50">
<h4 className="text-xs font-medium mb-1 text-gray-700">Add IMAP Account</h4>
<div className="mb-2 p-2 border border-gray-200 rounded-md bg-white">
<h4 className="text-xs font-medium mb-0.5 text-gray-700">Add IMAP Account</h4>
<form onSubmit={async (e) => {
e.preventDefault();
setLoading(true);
@ -776,57 +776,52 @@ export default function CourrierPage() {
setLoading(false);
}
}}>
<div className="space-y-1">
<div>
<Tabs defaultValue="imap" className="w-full">
<TabsList className="grid w-full grid-cols-2 h-7">
<TabsTrigger value="imap" className="text-xs">IMAP Settings</TabsTrigger>
<TabsTrigger value="smtp" className="text-xs">SMTP Settings</TabsTrigger>
<TabsList className="grid w-full grid-cols-2 h-6 mb-0.5 bg-gray-200">
<TabsTrigger value="imap" className="text-xs h-5 data-[state=active]:bg-black data-[state=active]:text-white">IMAP Settings</TabsTrigger>
<TabsTrigger value="smtp" className="text-xs h-5 data-[state=active]:bg-black data-[state=active]:text-white">SMTP Settings</TabsTrigger>
</TabsList>
<TabsContent value="imap" className="mt-1 space-y-1">
<TabsContent value="imap" className="mt-0.5 space-y-0.5">
<div>
<Label htmlFor="email" className="text-xs">Email</Label>
<Input
id="email"
name="email"
placeholder="email@example.com"
className="h-7 text-xs bg-white border-gray-300"
className="h-7 text-xs bg-white border-gray-300 mb-0.5"
required
/>
</div>
<div>
<Label htmlFor="password" className="text-xs">Password</Label>
<Input
id="password"
name="password"
type="password"
placeholder="•••••••••"
className="h-7 text-xs bg-white border-gray-300"
className="h-7 text-xs bg-white border-gray-300 mb-0.5"
required
/>
</div>
<div>
<Label htmlFor="display_name" className="text-xs">Display Name</Label>
<Input
id="display_name"
name="display_name"
placeholder="John Doe"
className="h-7 text-xs bg-white border-gray-300"
className="h-7 text-xs bg-white border-gray-300 mb-0.5"
/>
</div>
<div>
<Label htmlFor="host" className="text-xs">IMAP Server</Label>
<Input
id="host"
name="host"
placeholder="imap.example.com"
className="h-7 text-xs bg-white border-gray-300"
className="h-7 text-xs bg-white border-gray-300 mb-0.5"
required
/>
</div>
<div className="flex gap-2">
<div className="flex gap-1">
<div className="flex-1">
<Label htmlFor="port" className="text-xs">Port</Label>
<Input
id="port"
name="port"
@ -836,7 +831,7 @@ export default function CourrierPage() {
required
/>
</div>
<div className="flex items-end pb-1">
<div className="flex items-center pl-1">
<div className="flex items-center space-x-1">
<Checkbox id="secure" name="secure" defaultChecked />
<Label htmlFor="secure" className="text-xs">SSL</Label>
@ -845,19 +840,17 @@ export default function CourrierPage() {
</div>
</TabsContent>
<TabsContent value="smtp" className="mt-1 space-y-1">
<TabsContent value="smtp" className="mt-0.5 space-y-0.5">
<div>
<Label htmlFor="smtp_host" className="text-xs">SMTP Server</Label>
<Input
id="smtp_host"
name="smtp_host"
placeholder="smtp.example.com"
className="h-7 text-xs bg-white border-gray-300"
className="h-7 text-xs bg-white border-gray-300 mb-0.5"
/>
</div>
<div className="flex gap-2">
<div className="flex gap-1">
<div className="flex-1">
<Label htmlFor="smtp_port" className="text-xs">Port</Label>
<Input
id="smtp_port"
name="smtp_port"
@ -866,7 +859,7 @@ export default function CourrierPage() {
defaultValue="587"
/>
</div>
<div className="flex items-end pb-1">
<div className="flex items-center pl-1">
<div className="flex items-center space-x-1">
<Checkbox id="smtp_secure" name="smtp_secure" defaultChecked />
<Label htmlFor="smtp_secure" className="text-xs">SSL</Label>
@ -874,15 +867,15 @@ export default function CourrierPage() {
</div>
</div>
<div className="text-xs text-gray-500 italic">
Note: SMTP settings are only needed for sending emails
Note: SMTP settings needed for sending emails
</div>
</TabsContent>
</Tabs>
<div className="flex gap-2 pt-1">
<div className="flex gap-1 mt-1">
<Button
type="submit"
className="flex-1 h-7 text-xs bg-blue-600 hover:bg-blue-700 text-white rounded-md"
className="flex-1 h-7 text-xs bg-blue-500 hover:bg-blue-600 text-white rounded-md"
disabled={loading}
>
{loading ? <Loader2 className="h-3 w-3 animate-spin mr-1" /> : null}
@ -890,8 +883,7 @@ export default function CourrierPage() {
</Button>
<Button
type="button"
variant="outline"
className="h-7 text-xs"
className="h-7 text-xs bg-black text-white hover:bg-gray-800 rounded-md"
onClick={() => setShowAddAccountForm(false)}
>
Cancel