Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions src/components/Users/UserSummary.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
import { useAtom } from "jotai";
import { useState } from "react";
import { useTranslation } from "react-i18next";

import { developerModeAtom } from "@/atoms/developerMode";
import CareIcon from "@/CAREUI/icons/CareIcon";

import LanguageSelector from "@/components/Common/LanguageSelector";
import UserColumns, { userChildProps } from "@/components/Common/UserColumns";
import { Button } from "@/components/ui/button";
Comment on lines +1 to 5
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Label } from "@/components/ui/label";
import { Switch } from "@/components/ui/switch";

import { developerModeAtom } from "@/atoms/developerMode";

import LanguageSelector from "@/components/Common/LanguageSelector";
import UserColumns, { userChildProps } from "@/components/Common/UserColumns";
import ServiceTokenSection from "@/components/Users/ServiceTokenSection";
import { TwoFactorAuth } from "@/components/Users/TwoFactorAuth";
import UserAvatar from "@/components/Users/UserAvatar";
Expand All @@ -25,10 +18,12 @@ import {
ContactInfoDetails,
GeoOrgDetails,
} from "@/components/Users/UserViewDetails";

import useAuthUser from "@/hooks/useAuthUser";

import EditUserSheet from "@/pages/Organization/components/EditUserSheet";
import { PLUGIN_Component } from "@/PluginEngine";
import { useAtom } from "jotai";
import { useState } from "react";
import { useTranslation } from "react-i18next";
Comment thread
rithviknishad marked this conversation as resolved.

export default function UserSummaryTab({
userData,
Expand Down Expand Up @@ -205,6 +200,11 @@ export default function UserSummaryTab({
/>
</>
)}
<PLUGIN_Component
__name="UserProfileSections"
user={userData}
isOwnProfile={isOwnAccount}
/>
{authUser.is_superuser && (
<Card className="border-red-500">
<CardHeader className="px-4 sm:px-6">
Expand Down
10 changes: 9 additions & 1 deletion src/pluginTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from "@/types/emr/patient/patient";
import { FacilityRead } from "@/types/facility/facility";
import { PlugConfigMeta } from "@/types/plugConfig";
import { UserReadMinimal } from "@/types/user/user";
import { UserRead, UserReadMinimal } from "@/types/user/user";
import { ComponentType, LazyExoticComponent, ReactNode } from "react";
import { UseFormReturn } from "react-hook-form";
import { QuestionnaireFormState } from "./components/Questionnaire/QuestionnaireForm";
Expand Down Expand Up @@ -127,6 +127,13 @@ export type DeliveryOrderActionsComponentType = React.FC<{
locationId: string;
}>;

// Sections rendered on the user profile (summary) page
export type UserProfileSectionsComponentType = React.FC<{
user: UserRead;
isOwnProfile: boolean;
className?: string;
}>;
Comment thread
rithviknishad marked this conversation as resolved.

// Define supported plugin components
export type SupportedPluginComponents = {
DoctorConnectButtons: DoctorConnectButtonComponentType;
Expand All @@ -147,6 +154,7 @@ export type SupportedPluginComponents = {
DiagnosticReportOverride: DiagnosticReportOverrideComponentType;
PatientHomeQuickActions: PatientHomeActionsComponentType;
DeliveryOrderActions: DeliveryOrderActionsComponentType;
UserProfileSections: UserProfileSectionsComponentType;
};

// Create a type for lazy-loaded components
Expand Down
Loading