pushy

Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
2026-06-28 11:30:01 +08:00
parent b03b204861
commit bac7168b1e
100 changed files with 5958 additions and 1976 deletions
@@ -15,6 +15,8 @@ import { Avatar, AvatarImage, AvatarFallback } from "@/components/ui/avatar";
import { ACTION_CONFIG, getActionBadge } from "@/data/activity.data";
import { timeAgo } from "@/utils/timestamp.util";
import { fmtISO } from "@/utils/datetime.util";
import { useDateFormat } from "@/hooks/useDateFormat";
const BREADCRUMB = [
{ label: "Home", icon: <House className="size-4" />, to: "/admin" },
@@ -25,7 +27,7 @@ const LIMIT = 20;
function toDateStr(d) {
if (!d) return undefined;
return d.toLocaleDateString("en-CA"); // YYYY-MM-DD
return fmtISO(d);
}
export default function ActivityFeed() {
@@ -196,10 +198,9 @@ export default function ActivityFeed() {
// ─── DatePickerButton ─────────────────────────────────────────────────────────
function DatePickerButton({ value, onChange, placeholder, disabled }) {
const [open, setOpen] = useState(false);
const { fmtDate } = useDateFormat();
const label = value
? value.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" })
: placeholder;
const label = value ? fmtDate(value) : placeholder;
return (
<Popover open={open} onOpenChange={setOpen}>
@@ -252,6 +253,7 @@ function initials(name, email) {
}
function ActivityRow({ row, onViewUser }) {
const { fmtDateTime } = useDateFormat();
const { label, className } = getActionBadge(row.action);
const ts = row.created_at;
const displayName = row.full_name ?? row.email ?? `User #${row.user_id}`;
@@ -294,10 +296,7 @@ function ActivityRow({ row, onViewUser }) {
<span className="text-muted-foreground cursor-default">{timeAgo(ts)}</span>
</TooltipTrigger>
<TooltipContent side="left">
{new Date(ts).toLocaleString("en-US", {
month: "short", day: "numeric", year: "numeric",
hour: "numeric", minute: "2-digit", second: "2-digit",
})}
{fmtDateTime(ts)}
</TooltipContent>
</Tooltip>
) : (
@@ -11,6 +11,7 @@ import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip
import { ACTION_CONFIG, getActionBadge } from "@/data/activity.data";
import { timeAgo } from "@/utils/timestamp.util";
import { useDateFormat } from "@/hooks/useDateFormat";
const LIMIT = 20;
@@ -156,6 +157,7 @@ export default function UserActivityPage() {
// ─── Item ──────────────────────────────────────────────────────────────────────
function ActivityItem({ row }) {
const { fmtDateTime } = useDateFormat();
const { label, className } = getActionBadge(row.action);
const ts = row.created_at;
@@ -188,10 +190,7 @@ function ActivityItem({ row }) {
<span className="text-muted-foreground cursor-default">{timeAgo(ts)}</span>
</TooltipTrigger>
<TooltipContent side="left">
{new Date(ts).toLocaleString("en-US", {
month: "short", day: "numeric", year: "numeric",
hour: "numeric", minute: "2-digit", second: "2-digit",
})}
{fmtDateTime(ts)}
</TooltipContent>
</Tooltip>
) : (