refactor: improve layout of Last Run and Next Run fields in Database and Schedule config forms

This commit is contained in:
Arunavo Ray
2025-05-24 19:23:40 +05:30
parent a4e771d3bd
commit 7afe364a24
2 changed files with 30 additions and 22 deletions

View File

@@ -126,20 +126,24 @@ export function DatabaseCleanupConfigForm({
</div> </div>
)} )}
<div> <div className="flex gap-x-4">
<div className="flex-1">
<label className="block text-sm font-medium mb-1">Last Run</label> <label className="block text-sm font-medium mb-1">Last Run</label>
<div className="text-sm"> <div className="text-sm">
{config.lastRun ? formatDate(config.lastRun) : "Never"} {config.lastRun ? formatDate(config.lastRun) : "Never"}
</div> </div>
</div> </div>
{config.nextRun && config.enabled && ( {config.enabled && (
<div> <div className="flex-1">
<label className="block text-sm font-medium mb-1">Next Run</label> <label className="block text-sm font-medium mb-1">Next Run</label>
<div className="text-sm">{formatDate(config.nextRun)}</div> <div className="text-sm">
{config.nextRun ? formatDate(config.nextRun) : "Never"}
</div>
</div> </div>
)} )}
</div> </div>
</div>
</CardContent> </CardContent>
</Card> </Card>
); );

View File

@@ -130,20 +130,24 @@ export function ScheduleConfigForm({
</div> </div>
)} )}
<div> <div className="flex gap-x-4">
<div className="flex-1">
<label className="block text-sm font-medium mb-1">Last Run</label> <label className="block text-sm font-medium mb-1">Last Run</label>
<div className="text-sm"> <div className="text-sm">
{config.lastRun ? formatDate(config.lastRun) : "Never"} {config.lastRun ? formatDate(config.lastRun) : "Never"}
</div> </div>
</div> </div>
{config.nextRun && config.enabled && ( {config.enabled && (
<div> <div className="flex-1">
<label className="block text-sm font-medium mb-1">Next Run</label> <label className="block text-sm font-medium mb-1">Next Run</label>
<div className="text-sm">{formatDate(config.nextRun)}</div> <div className="text-sm">
{config.nextRun ? formatDate(config.nextRun) : "Never"}
</div>
</div> </div>
)} )}
</div> </div>
</div>
</CardContent> </CardContent>
</Card> </Card>
); );