diff --git a/app/home/(user)/(dashboard)/page.tsx b/app/home/(user)/(dashboard)/page.tsx index d697614..9917845 100644 --- a/app/home/(user)/(dashboard)/page.tsx +++ b/app/home/(user)/(dashboard)/page.tsx @@ -16,6 +16,7 @@ import { withI18n } from '~/lib/i18n/with-i18n'; import Dashboard from '../_components/dashboard'; import DashboardCards from '../_components/dashboard-cards'; import Recommendations from '../_components/recommendations'; +import RecommendationsSkeleton from '../_components/recommendations-skeleton'; import { loadCurrentUserAccount } from '../_lib/server/load-user-account'; export const generateMetadata = async () => { @@ -52,7 +53,10 @@ async function UserHomePage() { /> - }> +

+ +

+ }>
diff --git a/app/home/(user)/_components/recommendations-skeleton.tsx b/app/home/(user)/_components/recommendations-skeleton.tsx new file mode 100644 index 0000000..74cb352 --- /dev/null +++ b/app/home/(user)/_components/recommendations-skeleton.tsx @@ -0,0 +1,77 @@ +import React from 'react'; + +import { InfoTooltip } from '@/packages/shared/src/components/ui/info-tooltip'; +import { HeartPulse } from 'lucide-react'; + +import { Button } from '@kit/ui/shadcn/button'; +import { + Card, + CardDescription, + CardFooter, + CardHeader, +} from '@kit/ui/shadcn/card'; +import { Skeleton } from '@kit/ui/skeleton'; + +import OrderAnalysesCards from './order-analyses-cards'; + +const RecommendationsSkeleton = () => { + const emptyData = [ + { + title: '1', + description: '', + subtitle: '', + variant: { id: '' }, + price: 1, + }, + { + title: '2', + description: '', + subtitle: '', + variant: { id: '' }, + price: 1, + }, + ]; + return ( +
+ {emptyData.map(({ title, description, subtitle }) => ( + + + +
+
+
+ + +
+
+ {title} + {description && ( + <> + {' '} + + {description} +
+ } + /> + + )} + + {subtitle && {subtitle}} +
+
+ +
+
+ ))} +
+ ); +}; + +export default RecommendationsSkeleton; diff --git a/app/home/(user)/_components/recommendations.tsx b/app/home/(user)/_components/recommendations.tsx index 01d0b96..71403ef 100644 --- a/app/home/(user)/_components/recommendations.tsx +++ b/app/home/(user)/_components/recommendations.tsx @@ -4,8 +4,6 @@ import React from 'react'; import { AccountWithParams } from '@/packages/features/accounts/src/types/accounts'; -import { Trans } from '@kit/ui/makerkit/trans'; - import { loadAnalyses } from '../_lib/server/load-analyses'; import { loadRecommendations } from '../_lib/server/load-recommendations'; import OrderAnalysesCards from './order-analyses-cards'; @@ -27,11 +25,6 @@ export default async function Recommendations({ } return ( -
-

- -

- -
+ ); } diff --git a/packages/ui/src/shadcn/skeleton.tsx b/packages/ui/src/shadcn/skeleton.tsx index 9f09b6c..5b0ac1e 100644 --- a/packages/ui/src/shadcn/skeleton.tsx +++ b/packages/ui/src/shadcn/skeleton.tsx @@ -2,13 +2,23 @@ import { cn } from '../lib/utils'; function Skeleton({ className, + children, ...props }: React.HTMLAttributes) { return (
+ > +
+ {children ?? } +
+ +
+
); }