| 
5 | 5 | 	import HeadTitle from '$lib/common/HeadTitle.svelte';  | 
6 | 6 | 	import { onMount } from 'svelte';  | 
7 | 7 | 	import { myInfo } from '$lib/services/auth-service';  | 
8 |  | -    import Loader from '$lib/common/Loader.svelte';  | 
9 | 8 | 
  | 
10 | 9 | 	/** @type {import('$types').UserModel} */  | 
11 | 10 | 	let currentUser;  | 
12 | 11 | 	let isLoading = false;  | 
13 | 12 | 	onMount(async () => {  | 
14 |  | -        isLoading = true;  | 
15 |  | -		await myInfo().then(data => {  | 
16 |  | -            currentUser = data;  | 
17 |  | -        }).finally(() => {  | 
18 |  | -            isLoading = false;  | 
19 |  | -        });  | 
 | 13 | +		isLoading = true;  | 
 | 14 | +		await myInfo()  | 
 | 15 | +			.then((data) => {  | 
 | 16 | +				currentUser = data;  | 
 | 17 | +			})  | 
 | 18 | +			.finally(() => {  | 
 | 19 | +				isLoading = false;  | 
 | 20 | +			});  | 
20 | 21 | 	});  | 
21 | 22 | </script>  | 
22 | 23 | 
 
  | 
23 | 24 | <HeadTitle title="My Profile" />  | 
24 | 25 | <Breadcrumb title="Home" pagetitle="My Profile" />  | 
25 |  | -{#if isLoading}  | 
26 |  | -	<Loader />  | 
27 |  | -{/if}  | 
28 |  | -{#if !isLoading}  | 
29 |  | -	<Row>  | 
30 |  | -		<Col xl={4}>  | 
31 |  | -			<Card class="overflow-hidden">  | 
32 |  | -				<div class="bg-primary-subtle">  | 
33 |  | -					<Row class="row">  | 
34 |  | -						<Col xs={7}>  | 
35 |  | -							<div class="text-primary p-3">  | 
36 |  | -								<h5 class="text-primary">Welcome Back !</h5>  | 
37 |  | -								<p>{PUBLIC_BRAND_NAME}</p>  | 
38 |  | -							</div>  | 
39 |  | -						</Col>  | 
40 |  | -					</Row>  | 
 | 26 | +<Row>  | 
 | 27 | +	<Col xl={4}>  | 
 | 28 | +		<Card class="overflow-hidden">  | 
 | 29 | +			<div class="bg-primary-subtle">  | 
 | 30 | +				<Row class="row">  | 
 | 31 | +					<Col xs={7}>  | 
 | 32 | +						<div class="text-primary p-3">  | 
 | 33 | +							<h5 class="text-primary">Welcome Back !</h5>  | 
 | 34 | +							<p>{PUBLIC_BRAND_NAME}</p>  | 
 | 35 | +						</div>  | 
 | 36 | +					</Col>  | 
 | 37 | +				</Row>  | 
 | 38 | +			</div>  | 
 | 39 | +			<CardBody class="pt-0">  | 
 | 40 | +				<Row>  | 
 | 41 | +					<Col sm={4}>  | 
 | 42 | +						<div class="avatar-md profile-user-wid mb-4">  | 
 | 43 | +							<img  | 
 | 44 | +								src="/images/users/user-dummy.jpg"  | 
 | 45 | +								alt="avatar"  | 
 | 46 | +								class="img-thumbnail rounded-circle"  | 
 | 47 | +							/>  | 
 | 48 | +						</div>  | 
 | 49 | +						<h5 class="font-size-15 text-truncate">{currentUser?.full_name}</h5>  | 
 | 50 | +						<p class="text-muted mb-0 text-truncate">{currentUser?.role ?? 'Role: N/A'}</p>  | 
 | 51 | +					</Col>  | 
 | 52 | +				</Row>  | 
 | 53 | +			</CardBody>  | 
 | 54 | +		</Card>  | 
 | 55 | +		<Card>  | 
 | 56 | +			<CardBody>  | 
 | 57 | +				<CardTitle class="mb-4">Personal Information</CardTitle>  | 
 | 58 | +				<div class="table-responsive">  | 
 | 59 | +					<Table>  | 
 | 60 | +						<tbody>  | 
 | 61 | +							<tr>  | 
 | 62 | +								<th>First Name:</th>  | 
 | 63 | +								<td>  | 
 | 64 | +									{currentUser?.first_name ?? 'N/A'}  | 
 | 65 | +								</td>  | 
 | 66 | +							</tr>  | 
 | 67 | +							<tr>  | 
 | 68 | +								<th>Last Name:</th>  | 
 | 69 | +								<td>  | 
 | 70 | +									{currentUser?.last_name ?? 'N/A'}  | 
 | 71 | +								</td>  | 
 | 72 | +							</tr>  | 
 | 73 | +							<tr>  | 
 | 74 | +								<th>Email:</th>  | 
 | 75 | +								<td>  | 
 | 76 | +									{currentUser?.email ?? 'N/A'}  | 
 | 77 | +								</td>  | 
 | 78 | +							</tr>  | 
 | 79 | +							<tr>  | 
 | 80 | +								<th>External Id:</th>  | 
 | 81 | +								<td>  | 
 | 82 | +									{currentUser?.external_id ?? 'N/A'}  | 
 | 83 | +								</td>  | 
 | 84 | +							</tr>  | 
 | 85 | +							<tr>  | 
 | 86 | +								<th>Update Date:</th>  | 
 | 87 | +								<td>  | 
 | 88 | +									{currentUser?.update_date  | 
 | 89 | +										? new Date(currentUser?.update_date).toLocaleString()  | 
 | 90 | +										: 'N/A'}  | 
 | 91 | +								</td>  | 
 | 92 | +							</tr>  | 
 | 93 | +							<tr>  | 
 | 94 | +								<th>Create Date:</th>  | 
 | 95 | +								<td>  | 
 | 96 | +									{currentUser?.create_date  | 
 | 97 | +										? new Date(currentUser?.create_date).toLocaleString()  | 
 | 98 | +										: 'N/A'}  | 
 | 99 | +								</td>  | 
 | 100 | +							</tr>  | 
 | 101 | +						</tbody>  | 
 | 102 | +					</Table>  | 
41 | 103 | 				</div>  | 
42 |  | -				<CardBody class="pt-0">  | 
43 |  | -					<Row>  | 
44 |  | -						<Col sm={4}>  | 
45 |  | -							<div class="avatar-md profile-user-wid mb-4">  | 
46 |  | -								<img src="/images/users/user-dummy.jpg" alt="avatar" class="img-thumbnail rounded-circle" />  | 
47 |  | -							</div>  | 
48 |  | -							<h5 class="font-size-15 text-truncate">{currentUser?.full_name}</h5>  | 
49 |  | -							<p class="text-muted mb-0 text-truncate">{currentUser?.role ?? "Role: N/A"}</p>  | 
50 |  | -						</Col>  | 
51 |  | -					</Row>  | 
52 |  | -				</CardBody>  | 
53 |  | -			</Card>  | 
54 |  | -			<Card>  | 
55 |  | -				<CardBody>  | 
56 |  | -					<CardTitle class="mb-4">Personal Information</CardTitle>  | 
57 |  | -					<div class="table-responsive">  | 
58 |  | -						<Table>  | 
59 |  | -							<tbody>  | 
60 |  | -								<tr>  | 
61 |  | -									<th>First Name:</th>  | 
62 |  | -									<td>  | 
63 |  | -										{currentUser?.first_name ?? "N/A"}  | 
64 |  | -									</td>  | 
65 |  | -								</tr>  | 
66 |  | -								<tr>  | 
67 |  | -									<th>Last Name:</th>  | 
68 |  | -									<td>  | 
69 |  | -										{currentUser?.last_name ?? "N/A"}  | 
70 |  | -									</td>  | 
71 |  | -								</tr>  | 
72 |  | -								<tr>  | 
73 |  | -									<th>Email:</th>  | 
74 |  | -									<td>  | 
75 |  | -										{currentUser?.email ?? "N/A"}  | 
76 |  | -									</td>  | 
77 |  | -								</tr>  | 
78 |  | -								<tr>  | 
79 |  | -									<th>External Id:</th>  | 
80 |  | -									<td>  | 
81 |  | -										{currentUser?.external_id ?? "N/A"}  | 
82 |  | -									</td>  | 
83 |  | -								</tr>  | 
84 |  | -								<tr>  | 
85 |  | -									<th>Update Date:</th>  | 
86 |  | -									<td>  | 
87 |  | -										{currentUser?.update_date ? new Date(currentUser?.update_date).toLocaleString() : "N/A"}  | 
88 |  | -									</td>  | 
89 |  | -								</tr>  | 
90 |  | -								<tr>  | 
91 |  | -									<th>Create Date:</th>  | 
92 |  | -									<td>  | 
93 |  | -										{currentUser?.create_date ? new Date(currentUser?.create_date).toLocaleString() : "N/A"}  | 
94 |  | -									</td>  | 
95 |  | -								</tr>  | 
96 |  | -							</tbody>  | 
97 |  | -						</Table>  | 
98 |  | -					</div>  | 
99 |  | -				</CardBody>  | 
100 |  | -			</Card>  | 
101 |  | -		</Col>  | 
102 |  | -	</Row>  | 
103 |  | -{/if}  | 
 | 104 | +			</CardBody>  | 
 | 105 | +		</Card>  | 
 | 106 | +	</Col>  | 
 | 107 | +</Row>  | 
0 commit comments