import React from "react"; import { showToast } from "../../../toast/toastUtils"; import { usePermissions } from "../hooks/usePermissionManagement"; import { useTranslation } from "react-i18next"; function PermissionOverview({ refreshTrigger, onRefresh }) { const { permissions, loading, error, reload } = usePermissions(); const { t } = useTranslation('permission_management'); React.useEffect(() => { reload(); }, [refreshTrigger, reload]); React.useEffect(() => { if (!loading && !error) { showToast({ type: "success", message: t('messages.loadSuccess') }); } if (error) { showToast({ type: "error", message: error }); } }, [loading, error]); if (loading) { return (
{t('headings.noPermissionsDesc')}
| {t('table.name')} | {t('table.description')} | {t('table.status')} |
|---|---|---|
|
{p.name}
|
{p.description || t('table.noDescription')}
|
{p.is_active ? t('status.active') : t('status.inactive')} |