Files
aivideo/frontend-web/src/app/admin/(secure)/callback-logs/page.tsx

45 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"use client";
import { useQuery } from "@tanstack/react-query";
import { StatusBadge } from "@/components/status-badge";
import { api } from "@/lib/api";
type CallbackLog = {
id: number;
sourceType: string;
sourceCode: string;
relatedNo: string;
verifyStatus: string;
processStatus: string;
errorMessage: string;
};
export default function CallbackLogsPage() {
const query = useQuery({
queryKey: ["callback-logs"],
queryFn: () => api.get<CallbackLog[]>("/api/v1/admin/callback-logs"),
});
return (
<section className="panel">
<h3></h3>
<div className="list-grid">
{query.data?.map((item) => (
<div className="list-item" key={item.id}>
<div className="toolbar">
<strong>{item.sourceType} / {item.sourceCode}</strong>
<StatusBadge value={item.processStatus} />
</div>
<div className="muted">
{item.relatedNo || "-"} · {item.verifyStatus}
</div>
{item.errorMessage ? <div className="muted">{item.errorMessage}</div> : null}
</div>
))}
</div>
</section>
);
}