style(admin): replace text-link button styles with proper bordered buttons

Edit, Deactivate/Activate, and Delete actions in all admin table rows
were styled as plain text links (coloured text, no border or background).
Replaced with small pill-shaped bordered buttons that have a clear visual
affordance as interactive controls:

- Edit       → blue tinted border/bg  (primary-50 / primary-200)
- Deactivate → red tinted border/bg   (danger-50  / danger-200)
- Activate   → green tinted border/bg (success-50 / success-200)
- Delete     → white bg, red border; confirm state = solid red
- Cancel     → white bg, neutral border

Applies to: accounts, cost centres (vessels), users, vendors, products,
and the shared ConfirmDeleteButton component.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Hardik 2026-05-16 21:18:49 +05:30
parent 891e854c7c
commit 3646af5c64
6 changed files with 17 additions and 17 deletions

View file

@ -106,13 +106,13 @@ export function EditAccountButton({ account }: { account: AccountRow }) {
return ( return (
<> <>
<div className="flex items-center gap-3"> <div className="flex items-center gap-2">
<button onClick={() => setOpen(true)} <button onClick={() => setOpen(true)}
className="text-sm text-primary-600 hover:text-primary-700 font-medium"> className="rounded border border-primary-200 bg-primary-50 px-2.5 py-1 text-xs font-medium text-primary-700 hover:bg-primary-100 transition-colors">
Edit Edit
</button> </button>
<button onClick={handleToggle} disabled={toggling} <button onClick={handleToggle} disabled={toggling}
className={`text-sm font-medium ${account.isActive ? "text-danger-600 hover:text-danger-700" : "text-success-600 hover:text-success-700"}`}> className={`rounded border px-2.5 py-1 text-xs font-medium transition-colors disabled:opacity-50 ${account.isActive ? "border-danger-200 bg-danger-50 text-danger-700 hover:bg-danger-100" : "border-success-200 bg-success-50 text-success-700 hover:bg-success-100"}`}>
{toggling ? "…" : account.isActive ? "Deactivate" : "Activate"} {toggling ? "…" : account.isActive ? "Deactivate" : "Activate"}
</button> </button>
</div> </div>

View file

@ -91,7 +91,7 @@ export function ToggleProductButton({ product }: { product: ProductRow }) {
return ( return (
<button onClick={handleToggle} disabled={toggling} <button onClick={handleToggle} disabled={toggling}
className={`text-sm font-medium ${product.isActive ? "text-danger-600 hover:text-danger-700" : "text-success-600 hover:text-success-700"}`}> className={`rounded border px-2.5 py-1 text-xs font-medium transition-colors disabled:opacity-50 ${product.isActive ? "border-danger-200 bg-danger-50 text-danger-700 hover:bg-danger-100" : "border-success-200 bg-success-50 text-success-700 hover:bg-success-100"}`}>
{toggling ? "…" : product.isActive ? "Deactivate" : "Activate"} {toggling ? "…" : product.isActive ? "Deactivate" : "Activate"}
</button> </button>
); );

View file

@ -131,13 +131,13 @@ export function EditUserButton({ user }: { user: UserRow }) {
return ( return (
<> <>
<div className="flex items-center gap-3"> <div className="flex items-center gap-2">
<button onClick={() => setOpen(true)} <button onClick={() => setOpen(true)}
className="text-sm text-primary-600 hover:text-primary-700 font-medium"> className="rounded border border-primary-200 bg-primary-50 px-2.5 py-1 text-xs font-medium text-primary-700 hover:bg-primary-100 transition-colors">
Edit Edit
</button> </button>
<button onClick={handleToggle} disabled={toggling} <button onClick={handleToggle} disabled={toggling}
className={`text-sm font-medium ${user.isActive ? "text-danger-600 hover:text-danger-700" : "text-success-600 hover:text-success-700"}`}> className={`rounded border px-2.5 py-1 text-xs font-medium transition-colors disabled:opacity-50 ${user.isActive ? "border-danger-200 bg-danger-50 text-danger-700 hover:bg-danger-100" : "border-success-200 bg-success-50 text-success-700 hover:bg-success-100"}`}>
{toggling ? "…" : user.isActive ? "Deactivate" : "Activate"} {toggling ? "…" : user.isActive ? "Deactivate" : "Activate"}
</button> </button>
</div> </div>

View file

@ -299,14 +299,14 @@ export function EditVendorButton({ vendor }: { vendor: VendorRow }) {
return ( return (
<> <>
<button onClick={() => setOpen(true)} className="text-sm text-primary-600 hover:underline font-medium">Edit</button> <button onClick={() => setOpen(true)} className="rounded border border-primary-200 bg-primary-50 px-2.5 py-1 text-xs font-medium text-primary-700 hover:bg-primary-100 transition-colors">Edit</button>
<AdminDialog title={`Edit — ${vendor.name}`} open={open} onClose={() => setOpen(false)}> <AdminDialog title={`Edit — ${vendor.name}`} open={open} onClose={() => setOpen(false)}>
<form onSubmit={handleSubmit} className="space-y-4"> <form onSubmit={handleSubmit} className="space-y-4">
<VendorFormFields vendor={vendor} /> <VendorFormFields vendor={vendor} />
{error && <p className="text-sm text-danger-700 bg-danger-50 rounded-lg px-3 py-2">{error}</p>} {error && <p className="text-sm text-danger-700 bg-danger-50 rounded-lg px-3 py-2">{error}</p>}
<div className="flex items-center justify-between"> <div className="flex items-center justify-between">
<button type="button" onClick={handleToggle} <button type="button" onClick={handleToggle}
className={`text-xs underline ${vendor.isActive ? "text-danger-600" : "text-success-600"}`}> className={`rounded border px-2.5 py-1 text-xs font-medium transition-colors ${vendor.isActive ? "border-danger-200 bg-danger-50 text-danger-700 hover:bg-danger-100" : "border-success-200 bg-success-50 text-success-700 hover:bg-success-100"}`}>
{vendor.isActive ? "Deactivate" : "Activate"} {vendor.isActive ? "Deactivate" : "Activate"}
</button> </button>
<div className="flex gap-3"> <div className="flex gap-3">

View file

@ -98,13 +98,13 @@ export function EditVesselButton({ vessel }: { vessel: VesselRow }) {
return ( return (
<> <>
<div className="flex items-center gap-3"> <div className="flex items-center gap-2">
<button onClick={() => setOpen(true)} <button onClick={() => setOpen(true)}
className="text-sm text-primary-600 hover:text-primary-700 font-medium"> className="rounded border border-primary-200 bg-primary-50 px-2.5 py-1 text-xs font-medium text-primary-700 hover:bg-primary-100 transition-colors">
Edit Edit
</button> </button>
<button onClick={handleToggle} disabled={toggling} <button onClick={handleToggle} disabled={toggling}
className={`text-sm font-medium ${vessel.isActive ? "text-danger-600 hover:text-danger-700" : "text-success-600 hover:text-success-700"}`}> className={`rounded border px-2.5 py-1 text-xs font-medium transition-colors disabled:opacity-50 ${vessel.isActive ? "border-danger-200 bg-danger-50 text-danger-700 hover:bg-danger-100" : "border-success-200 bg-success-50 text-success-700 hover:bg-success-100"}`}>
{toggling ? "…" : vessel.isActive ? "Deactivate" : "Activate"} {toggling ? "…" : vessel.isActive ? "Deactivate" : "Activate"}
</button> </button>
</div> </div>

View file

@ -19,8 +19,8 @@ export function ConfirmDeleteButton({
if (confirming) { if (confirming) {
return ( return (
<span className="inline-flex items-center gap-2 flex-wrap"> <span className="inline-flex items-center gap-1.5 flex-wrap">
<span className="text-xs text-neutral-600 whitespace-nowrap">Delete {label}?</span> <span className="text-xs text-neutral-500 whitespace-nowrap">Delete {label}?</span>
<button <button
onClick={() => onClick={() =>
startTransition(async () => { startTransition(async () => {
@ -34,13 +34,13 @@ export function ConfirmDeleteButton({
}) })
} }
disabled={isPending} disabled={isPending}
className="text-xs font-medium text-danger-600 hover:text-danger-800 hover:underline disabled:opacity-50 whitespace-nowrap" className="rounded border border-danger-400 bg-danger-600 px-2 py-0.5 text-xs font-semibold text-white hover:bg-danger-700 disabled:opacity-50 whitespace-nowrap transition-colors"
> >
{isPending ? "Deleting…" : "Confirm"} {isPending ? "Deleting…" : "Confirm"}
</button> </button>
<button <button
onClick={() => { setConfirming(false); setError(""); }} onClick={() => { setConfirming(false); setError(""); }}
className="text-xs text-neutral-500 hover:underline whitespace-nowrap" className="rounded border border-neutral-300 bg-white px-2 py-0.5 text-xs text-neutral-600 hover:bg-neutral-50 whitespace-nowrap transition-colors"
> >
Cancel Cancel
</button> </button>
@ -52,7 +52,7 @@ export function ConfirmDeleteButton({
return ( return (
<button <button
onClick={() => setConfirming(true)} onClick={() => setConfirming(true)}
className="text-xs text-danger-500 hover:text-danger-700 hover:underline" className="rounded border border-danger-200 bg-white px-2.5 py-1 text-xs font-medium text-danger-600 hover:bg-danger-50 hover:border-danger-300 transition-colors"
> >
Delete Delete
</button> </button>