- Add UI components: confirm-delete-dialog, empty-table-row, list-pagination, pagination, status-badge - Add form-fields directory for reusable form field components - Add hooks: use-action-mutation, use-action-query for server action integration - Add action-utils lib for action state helpers - Update a11y components, charts, global-search, onboarding-gate, question components - Update UI components: chip-nav, filter-bar, page-header, stat-card, stat-item, switch, table - Update hooks: use-action-with-toast, use-aria-live, use-debounce, use-local-storage, use-media-query, use-permission - Update lib: a11y, ai, audit-logger, auth-guard, bcrypt-utils, change-logger, download, excel, file-storage, http-utils, login-logger, password-policy, password-security-service, permissions, rate-limit, role-utils, search-params, session, storage-provider - Update types: action-state, permissions - Update i18n messages (en, zh-CN) for dashboard, diagnostic, grades, lesson-preparation, settings
38 lines
920 B
TypeScript
38 lines
920 B
TypeScript
import {
|
||
TableCell,
|
||
TableRow,
|
||
} from "@/shared/components/ui/table"
|
||
|
||
/**
|
||
* 表格空行:统一的"无数据"占位行。
|
||
*
|
||
* 覆盖以下重复模式(3 个审计表格逐行复制):
|
||
* - audit-log-table.tsx: colSpan=7, "No audit logs found."
|
||
* - login-log-table.tsx: colSpan=6, "No login logs found."
|
||
* - data-change-log-table.tsx: colSpan=7, "No data change logs found."
|
||
*
|
||
* 结构:TableRow > TableCell(colSpan, h-24, text-center, text-muted-foreground)。
|
||
*/
|
||
interface EmptyTableRowProps {
|
||
/** 跨列数 */
|
||
colSpan: number
|
||
/** 空状态文案(默认 "No data found.") */
|
||
message?: string
|
||
}
|
||
|
||
export function EmptyTableRow({
|
||
colSpan,
|
||
message = "No data found.",
|
||
}: EmptyTableRowProps) {
|
||
return (
|
||
<TableRow>
|
||
<TableCell
|
||
colSpan={colSpan}
|
||
className="h-24 text-center text-muted-foreground"
|
||
>
|
||
{message}
|
||
</TableCell>
|
||
</TableRow>
|
||
)
|
||
}
|