Skip to content

Commit

Permalink
message skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaJ2305 committed Jan 15, 2025
1 parent b257820 commit 612ce21
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
16 changes: 16 additions & 0 deletions src/components/Common/UseSkeletons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,22 @@ export const FacilityOrganizationSkeleton = () => {
);
};

export const MessageSkeleton = () => (
<div className="space-y-4">
{Array.from({ length: 3 }).map((_, i) => (
<div key={i} className="p-4 rounded-lg bg-gray-100 animate-pulse">
<div className="flex items-start gap-3">
<div className="w-8 h-8 rounded-full bg-gray-200" />
<div className="flex-1 space-y-2">
<Skeleton className="h-4 w-24" />
<Skeleton className="h-4 w-3/4" />
</div>
</div>
</div>
))}
</div>
);

export const OrganizationIndexSkeleton = () => {
const { t } = useTranslation();
return (
Expand Down
19 changes: 1 addition & 18 deletions src/pages/Encounters/tabs/EncounterNotesTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import { Input } from "@/components/ui/input";
import { Markdown } from "@/components/ui/markdown";
import { ScrollArea } from "@/components/ui/scroll-area";
import { Sheet, SheetContent } from "@/components/ui/sheet";
import { Skeleton } from "@/components/ui/skeleton";
import { Textarea } from "@/components/ui/textarea";
import {
Tooltip,
Expand All @@ -45,6 +44,7 @@ import {

import { Avatar } from "@/components/Common/Avatar";
import Loading from "@/components/Common/Loading";
import { MessageSkeleton } from "@/components/Common/UseSkeletons";

import useAuthUser from "@/hooks/useAuthUser";

Expand All @@ -69,23 +69,6 @@ const threadTemplates = [
"Lab Results Discussion",
] as const;

// Component to display loading skeleton for messages
const MessageSkeleton = () => (
<div className="space-y-4">
{Array.from({ length: 3 }).map((_, i) => (
<div key={i} className="p-4 rounded-lg bg-gray-100 animate-pulse">
<div className="flex items-start gap-3">
<div className="w-8 h-8 rounded-full bg-gray-200" />
<div className="flex-1 space-y-2">
<Skeleton className="h-4 w-24" />
<Skeleton className="h-4 w-3/4" />
</div>
</div>
</div>
))}
</div>
);

// Info tooltip component for help text
const InfoTooltip = ({ content }: { content: string }) => (
<TooltipProvider>
Expand Down

0 comments on commit 612ce21

Please sign in to comment.