Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/entities/student/model/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const studentDetailSchema = z
id: z.number(),
name: z.string(),
studentId: z.union([z.string(), z.number()]).transform((v) => String(v)),
email: z.string(),
email: z.string().nullable(),
title: z.string(),
score: z.number(),
totalScore: z.number(),
Expand Down
7 changes: 6 additions & 1 deletion src/entities/student/ui/StudentProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface StudentProfileProps {
name: string;
studentId: string;
onChat?: () => void;
email: string;
email: string | null;
}

export const StudentProfile = ({
Expand All @@ -16,6 +16,10 @@ export const StudentProfile = ({
email,
}: StudentProfileProps) => {
const sendEmail = () => {
if (!email) {
alert('등록된 이메일이 없습니다.');
return;
}
window.location.href = `mailto:${email}`;
};

Expand Down Expand Up @@ -45,6 +49,7 @@ export const StudentProfile = ({
size='compact'
content='mixed'
type='button'
disabled={!email}
onClick={sendEmail}>
<div className='flex gap-2.5 items-center'>
<MailIcon />
Expand Down
Loading