|
|
|
@ -4,6 +4,7 @@ import { useState } from 'react';
|
|
|
|
|
import { Button, Spinner } from '@tih/ui';
|
|
|
|
|
|
|
|
|
|
import DashboardProfileCard from '~/components/offers/dashboard/DashboardProfileCard';
|
|
|
|
|
import Container from '~/components/shared/Container';
|
|
|
|
|
|
|
|
|
|
import { trpc } from '~/utils/trpc';
|
|
|
|
|
|
|
|
|
@ -30,19 +31,21 @@ export default function ProfilesDashboard() {
|
|
|
|
|
|
|
|
|
|
if (status === 'loading' || userProfilesQuery.isLoading) {
|
|
|
|
|
return (
|
|
|
|
|
<div className="flex h-screen w-screen">
|
|
|
|
|
<div className="flex w-full">
|
|
|
|
|
<div className="m-auto mx-auto w-full justify-center">
|
|
|
|
|
<Spinner className="m-10" display="block" size="lg" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (status === 'unauthenticated') {
|
|
|
|
|
signIn();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (userProfiles.length === 0) {
|
|
|
|
|
return (
|
|
|
|
|
<div className="flex h-screen w-screen">
|
|
|
|
|
<div className="flex w-full">
|
|
|
|
|
<div className="m-auto mx-auto w-full justify-center text-xl">
|
|
|
|
|
<div className="mb-8 flex w-full flex-row justify-center">
|
|
|
|
|
<h2>You have not saved any offer profiles yet.</h2>
|
|
|
|
@ -59,10 +62,11 @@ export default function ProfilesDashboard() {
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<Container variant="xs">
|
|
|
|
|
{userProfilesQuery.isLoading && (
|
|
|
|
|
<div className="flex h-screen w-screen">
|
|
|
|
|
<div className="flex h-screen">
|
|
|
|
|
<div className="m-auto mx-auto w-full justify-center">
|
|
|
|
|
<Spinner className="m-10" display="block" size="lg" />
|
|
|
|
|
</div>
|
|
|
|
@ -70,19 +74,17 @@ export default function ProfilesDashboard() {
|
|
|
|
|
)}
|
|
|
|
|
{!userProfilesQuery.isLoading && (
|
|
|
|
|
<div className="overflow-y-auto py-8">
|
|
|
|
|
<h1 className="mx-auto mb-4 w-3/4 text-start text-4xl font-bold text-slate-900">
|
|
|
|
|
<h1 className="mx-auto mb-4 text-start text-4xl font-bold text-slate-900">
|
|
|
|
|
Your dashboard
|
|
|
|
|
</h1>
|
|
|
|
|
<p className="mx-auto w-3/4 text-start text-xl text-slate-900">
|
|
|
|
|
Save your offer profiles to dashboard to easily access and edit them
|
|
|
|
|
later.
|
|
|
|
|
<p className="mt-4 text-xl leading-8 text-slate-500">
|
|
|
|
|
Save your offer profiles to your dashboard to easily access and edit
|
|
|
|
|
them later.
|
|
|
|
|
</p>
|
|
|
|
|
<div className="justfy-center mt-8 flex w-screen">
|
|
|
|
|
<ul className="mx-auto w-3/4 space-y-3" role="list">
|
|
|
|
|
<div className="mt-8 flex justify-center">
|
|
|
|
|
<ul className="w-full space-y-4" role="list">
|
|
|
|
|
{userProfiles?.map((profile) => (
|
|
|
|
|
<li
|
|
|
|
|
key={profile.id}
|
|
|
|
|
className="overflow-hidden bg-white px-4 py-4 shadow sm:rounded-md sm:px-6">
|
|
|
|
|
<li key={profile.id}>
|
|
|
|
|
<DashboardProfileCard key={profile.id} profile={profile} />
|
|
|
|
|
</li>
|
|
|
|
|
))}
|
|
|
|
@ -90,6 +92,6 @@ export default function ProfilesDashboard() {
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</>
|
|
|
|
|
</Container>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|