refine role management cards with richer metadata

Improve role card visual hierarchy and add clearer metadata (role type, id, created date, description preview) so the list feels less sparse and more informative.

Made-with: Cursor
This commit is contained in:
Yared Yemane 2026-04-14 06:27:30 -07:00
parent e5d1ba9b8d
commit 06a0daedfe

View File

@ -302,7 +302,7 @@ export function RolesListPage() {
{roles.map((role) => ( {roles.map((role) => (
<Card <Card
key={role.id} key={role.id}
className="overflow-hidden shadow-sm transition-shadow hover:shadow-md" className="overflow-hidden border border-grayScale-100 shadow-sm transition-all hover:-translate-y-0.5 hover:shadow-md"
> >
<div <div
className={cn( className={cn(
@ -312,7 +312,7 @@ export function RolesListPage() {
: "bg-gradient-to-r from-brand-500 to-brand-600", : "bg-gradient-to-r from-brand-500 to-brand-600",
)} )}
/> />
<CardContent className="p-5"> <CardContent className="space-y-4 p-5">
<div className="flex items-start justify-between gap-3"> <div className="flex items-start justify-between gap-3">
<div className="flex items-center gap-2.5"> <div className="flex items-center gap-2.5">
<div <div
@ -330,23 +330,37 @@ export function RolesListPage() {
)} )}
</div> </div>
<div> <div>
<h3 className="text-sm font-semibold text-grayScale-700">{role.name}</h3> <h3 className="text-sm font-semibold uppercase tracking-wide text-grayScale-700">
<p className="mt-0.5 text-xs text-grayScale-400 line-clamp-1"> {role.name}
{role.description} </h3>
<p className="mt-0.5 text-xs text-grayScale-500 line-clamp-2">
{role.description?.trim() || "No description provided for this role."}
</p> </p>
</div> </div>
</div> </div>
{role.is_system && ( <Badge
<Badge variant="warning" className="shrink-0 text-[10px]"> variant={role.is_system ? "warning" : "outline"}
System className="shrink-0 text-[10px]"
</Badge> >
)} {role.is_system ? "System" : "Custom"}
</Badge>
</div> </div>
<div className="mt-4 flex items-center justify-between"> <div className="grid grid-cols-2 gap-2 rounded-xl border border-grayScale-100 bg-grayScale-50/70 p-2.5 text-[11px]">
<span className="text-[11px] text-grayScale-400"> <div>
Created {new Date(role.created_at).toLocaleDateString()} <p className="text-grayScale-400">Role ID</p>
</span> <p className="font-semibold text-grayScale-700">#{role.id}</p>
</div>
<div>
<p className="text-grayScale-400">Created</p>
<p className="font-semibold text-grayScale-700">
{new Date(role.created_at).toLocaleDateString()}
</p>
</div>
</div>
<div className="flex items-center justify-between">
<span className="text-[11px] text-grayScale-400">Open details to view permissions</span>
<Button <Button
variant="outline" variant="outline"
size="sm" size="sm"