feat(student): fixed profile css
This commit is contained in:
@@ -28,7 +28,7 @@ import {
|
|||||||
X,
|
X,
|
||||||
Edit,
|
Edit,
|
||||||
Download,
|
Download,
|
||||||
Share2
|
Share2,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { Switch } from '@workspace/ui/components/switch';
|
import { Switch } from '@workspace/ui/components/switch';
|
||||||
|
|
||||||
@@ -39,19 +39,22 @@ interface StudentDetailsModalProps {
|
|||||||
markoutAction: (state: boolean) => void;
|
markoutAction: (state: boolean) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function StudentDetailsModal({ student, isOpen, onClose, markoutAction }: StudentDetailsModalProps) {
|
export function StudentDetailsModal({
|
||||||
const fullName = [
|
student,
|
||||||
student.firstName,
|
isOpen,
|
||||||
student.middleName,
|
onClose,
|
||||||
student.lastName
|
markoutAction,
|
||||||
].filter(Boolean).join(' ') || 'Name not provided';
|
}: StudentDetailsModalProps) {
|
||||||
|
const fullName =
|
||||||
|
[student.firstName, student.middleName, student.lastName].filter(Boolean).join(' ') ||
|
||||||
|
'Name not provided';
|
||||||
|
|
||||||
const formatDate = (date: Date | null) => {
|
const formatDate = (date: Date | null) => {
|
||||||
if (!date) return 'Not provided';
|
if (!date) return 'Not provided';
|
||||||
return new Date(date).toLocaleDateString('en-US', {
|
return new Date(date).toLocaleDateString('en-US', {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
month: 'long',
|
month: 'long',
|
||||||
day: 'numeric'
|
day: 'numeric',
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -76,9 +79,7 @@ export function StudentDetailsModal({ student, isOpen, onClose, markoutAction }:
|
|||||||
<DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto">
|
<DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto">
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<DialogTitle className="text-2xl font-bold text-gray-800">
|
<DialogTitle className="text-2xl font-bold text-gray-800">Student Details</DialogTitle>
|
||||||
Student Details
|
|
||||||
</DialogTitle>
|
|
||||||
<div className="flex items-center gap-4">
|
<div className="flex items-center gap-4">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<Switch
|
<Switch
|
||||||
@@ -100,7 +101,7 @@ export function StudentDetailsModal({ student, isOpen, onClose, markoutAction }:
|
|||||||
<span className="sr-only">Close</span>
|
<span className="sr-only">Close</span>
|
||||||
</Button>
|
</Button>
|
||||||
</DialogClose>
|
</DialogClose>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
|
|
||||||
@@ -110,8 +111,11 @@ export function StudentDetailsModal({ student, isOpen, onClose, markoutAction }:
|
|||||||
<Avatar className="w-20 h-20">
|
<Avatar className="w-20 h-20">
|
||||||
<AvatarImage src={student.profilePicture || undefined} />
|
<AvatarImage src={student.profilePicture || undefined} />
|
||||||
<AvatarFallback className="bg-gradient-to-br from-blue-500 to-purple-600 text-white text-2xl font-bold">
|
<AvatarFallback className="bg-gradient-to-br from-blue-500 to-purple-600 text-white text-2xl font-bold">
|
||||||
{student.firstName ? student.firstName.charAt(0).toUpperCase() :
|
{student.firstName
|
||||||
student.email ? student.email.charAt(0).toUpperCase() : 'S'}
|
? student.firstName.charAt(0).toUpperCase()
|
||||||
|
: student.email
|
||||||
|
? student.email.charAt(0).toUpperCase()
|
||||||
|
: 'S'}
|
||||||
</AvatarFallback>
|
</AvatarFallback>
|
||||||
</Avatar>
|
</Avatar>
|
||||||
|
|
||||||
@@ -119,7 +123,7 @@ export function StudentDetailsModal({ student, isOpen, onClose, markoutAction }:
|
|||||||
<div className="flex items-center gap-3 mb-2">
|
<div className="flex items-center gap-3 mb-2">
|
||||||
<h2 className="text-2xl font-bold text-gray-800">{fullName}</h2>
|
<h2 className="text-2xl font-bold text-gray-800">{fullName}</h2>
|
||||||
<Badge
|
<Badge
|
||||||
variant={student.verified ? "default" : "secondary"}
|
variant={student.verified ? 'default' : 'secondary'}
|
||||||
className={`${student.verified ? 'bg-green-100 text-green-700' : 'bg-yellow-100 text-yellow-700'}`}
|
className={`${student.verified ? 'bg-green-100 text-green-700' : 'bg-yellow-100 text-yellow-700'}`}
|
||||||
>
|
>
|
||||||
{student.verified ? 'Verified' : 'Pending Verification'}
|
{student.verified ? 'Verified' : 'Pending Verification'}
|
||||||
@@ -135,6 +139,45 @@ export function StudentDetailsModal({ student, isOpen, onClose, markoutAction }:
|
|||||||
Joined: {formatDate(new Date(Number(student.createdAt)))}
|
Joined: {formatDate(new Date(Number(student.createdAt)))}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
{/* Skills & Expertise */}
|
||||||
|
{student.skills && student.skills.length > 0 && (
|
||||||
|
<div className="space-y-4">
|
||||||
|
<h3 className="text-lg font-semibold text-gray-800 flex items-center gap-2">
|
||||||
|
<Award className="w-5 h-5 text-orange-600" />
|
||||||
|
Skills & Expertise
|
||||||
|
</h3>
|
||||||
|
<div className="flex flex-wrap gap-2">
|
||||||
|
{student.skills.map((skill, index) => (
|
||||||
|
<Badge key={index} variant="outline" className="text-sm">
|
||||||
|
{skill}
|
||||||
|
</Badge>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{/* Professional Links */}
|
||||||
|
{(student.linkedin || student.github) && (
|
||||||
|
<div className="space-y-4">
|
||||||
|
<h3 className="text-lg font-semibold text-gray-800 flex items-center gap-2">
|
||||||
|
<ExternalLink className="w-5 h-5 text-blue-600" />
|
||||||
|
Professional Links
|
||||||
|
</h3>
|
||||||
|
<div className="flex gap-3">
|
||||||
|
{student.linkedin && (
|
||||||
|
<Button variant="outline" size="sm" className="flex items-center gap-2">
|
||||||
|
<Linkedin className="w-4 h-4" />
|
||||||
|
LinkedIn
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
{student.github && (
|
||||||
|
<Button variant="outline" size="sm" className="flex items-center gap-2">
|
||||||
|
<Github className="w-4 h-4" />
|
||||||
|
GitHub
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex gap-2">
|
<div className="flex gap-2">
|
||||||
@@ -297,50 +340,45 @@ export function StudentDetailsModal({ student, isOpen, onClose, markoutAction }:
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Semester-wise Performance */}
|
||||||
|
{student.grades && student.grades.length > 0 && (
|
||||||
|
<div className="space-y-3 mt-4">
|
||||||
|
<h4 className="text-md font-semibold text-gray-700">Semester-wise Performance</h4>
|
||||||
|
<div className="overflow-x-auto rounded-lg border border-gray-200">
|
||||||
|
<table className="w-full text-sm">
|
||||||
|
<thead className="bg-gray-50">
|
||||||
|
<tr>
|
||||||
|
<th className="text-left py-2 px-3">Semester</th>
|
||||||
|
<th className="text-left py-2 px-3">SGPI</th>
|
||||||
|
<th className="text-left py-2 px-3">KT</th>
|
||||||
|
<th className="text-left py-2 px-3">Dead KT</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{student.grades
|
||||||
|
.slice()
|
||||||
|
.sort((a, b) => (a.sem ?? 0) - (b.sem ?? 0))
|
||||||
|
.map((grade) => (
|
||||||
|
<tr key={grade.sem} className="border-t">
|
||||||
|
<td className="py-2 px-3">{grade.sem}</td>
|
||||||
|
<td className="py-2 px-3">{String(grade.sgpi)}</td>
|
||||||
|
<td className="py-2 px-3">{grade.isKT ? 'Yes' : 'No'}</td>
|
||||||
|
<td className="py-2 px-3">{grade.deadKT ? 'Yes' : 'No'}</td>
|
||||||
|
</tr>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{/* Skills Section */}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Skills Section */}
|
|
||||||
{student.skills && student.skills.length > 0 && (
|
|
||||||
<div className="space-y-4">
|
|
||||||
<h3 className="text-lg font-semibold text-gray-800 flex items-center gap-2">
|
|
||||||
<Award className="w-5 h-5 text-orange-600" />
|
|
||||||
Skills & Expertise
|
|
||||||
</h3>
|
|
||||||
<div className="flex flex-wrap gap-2">
|
|
||||||
{student.skills.map((skill, index) => (
|
|
||||||
<Badge key={index} variant="outline" className="text-sm">
|
|
||||||
{skill}
|
|
||||||
</Badge>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Professional Links */}
|
|
||||||
{(student.linkedin || student.github) && (
|
|
||||||
<div className="space-y-4">
|
|
||||||
<h3 className="text-lg font-semibold text-gray-800 flex items-center gap-2">
|
|
||||||
<ExternalLink className="w-5 h-5 text-blue-600" />
|
|
||||||
Professional Links
|
|
||||||
</h3>
|
|
||||||
<div className="flex gap-3">
|
|
||||||
{student.linkedin && (
|
|
||||||
<Button variant="outline" size="sm" className="flex items-center gap-2">
|
|
||||||
<Linkedin className="w-4 h-4" />
|
|
||||||
LinkedIn
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
{student.github && (
|
|
||||||
<Button variant="outline" size="sm" className="flex items-center gap-2">
|
|
||||||
<Github className="w-4 h-4" />
|
|
||||||
GitHub
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Footer Actions */}
|
{/* Footer Actions */}
|
||||||
<Separator />
|
<Separator />
|
||||||
<div className="flex justify-end gap-3">
|
<div className="flex justify-end gap-3">
|
||||||
@@ -353,3 +391,4 @@ export function StudentDetailsModal({ student, isOpen, onClose, markoutAction }:
|
|||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user