feat: almost done with most ts stuff

This commit is contained in:
=
2025-10-10 00:09:46 +05:30
parent 44c9575a3d
commit c2490380f0
28 changed files with 551 additions and 1432 deletions
@@ -1,6 +1,7 @@
import {
faArrowDown,
faArrowUp,
faBan,
faEdit,
faEllipsisV,
faEye,
@@ -30,7 +31,7 @@ import {
THead,
Tr
} from "@app/components/v2";
import { OrgPermissionSubjects, useOrganization } from "@app/context";
import { OrgPermissionSubjects, useOrganization, useSubscription } from "@app/context";
import { OrgPermissionMachineIdentityAuthTemplateActions } from "@app/context/OrgPermissionContext/types";
import {
getUserTablePreference,
@@ -86,12 +87,14 @@ export const IdentityAuthTemplatesTable = ({ handlePopUpOpen }: Props) => {
};
const organizationId = currentOrg?.id || "";
const { subscription } = useSubscription();
const { data, isPending, isFetching } = useGetIdentityAuthTemplates({
organizationId,
limit,
offset,
search: debouncedSearch
search: debouncedSearch,
isDisabled: !subscription.machineIdentityAuthTemplates
});
const { templates = [], totalCount = 0 } = data ?? {};
@@ -172,7 +175,10 @@ export const IdentityAuthTemplatesTable = ({ handlePopUpOpen }: Props) => {
</Tr>
</THead>
<TBody>
{isPending && <TableSkeleton columns={4} innerKey="identity-auth-templates" />}
{subscription.machineIdentityAuthTemplates && isPending && (
<TableSkeleton columns={4} innerKey="identity-auth-templates" />
)}
{!isPending &&
templates?.map((template) => (
<Tr
@@ -265,6 +271,9 @@ export const IdentityAuthTemplatesTable = ({ handlePopUpOpen }: Props) => {
onChangePerPage={handlePerPageChange}
/>
)}
{!subscription.machineIdentityAuthTemplates && (
<EmptyState title="This feature is not yet activated for your license." icon={faBan} />
)}
{!isPending && templates.length === 0 && (
<EmptyState
title={