diff --git a/app/mail/page.tsx b/app/email/page.tsx similarity index 80% rename from app/mail/page.tsx rename to app/email/page.tsx index 94c35441..13d1dfeb 100644 --- a/app/mail/page.tsx +++ b/app/email/page.tsx @@ -10,11 +10,16 @@ export default async function Page() { redirect("/signin"); } + const mailUrl = process.env.NEXT_PUBLIC_IFRAME_MAIL_URL; + if (!mailUrl) { + console.warn("NEXT_PUBLIC_IFRAME_MAIL_URL is not defined in environment variables"); + } + return (
void; } +interface MenuItem { + title: string; + icon: any; + href: string; + iframe?: string; + external?: boolean; + requiredRole?: string; +} + export function Sidebar({ isOpen, onClose }: SidebarProps) { const { data: session } = useSession(); const router = useRouter(); @@ -57,7 +66,7 @@ export function Sidebar({ isOpen, onClose }: SidebarProps) { }; // Base menu items (available for everyone) - const baseMenuItems = [ + const baseMenuItems: MenuItem[] = [ { title: "Diary", icon: BookOpen, @@ -71,9 +80,9 @@ export function Sidebar({ isOpen, onClose }: SidebarProps) { external: false, }, { - title: "Mail", + title: "Email", icon: Mail, - href: "/mail", + href: "/email", iframe: process.env.NEXT_PUBLIC_IFRAME_MAIL_URL, }, { @@ -121,7 +130,7 @@ export function Sidebar({ isOpen, onClose }: SidebarProps) { ]; // Role-specific menu items - const roleSpecificItems = [ + const roleSpecificItems: MenuItem[] = [ { title: "Artlab", icon: Palette, @@ -159,7 +168,7 @@ export function Sidebar({ isOpen, onClose }: SidebarProps) { ]; const handleNavigation = (href: string, external?: boolean) => { - if (external) { + if (external && href) { window.open(href, "_blank"); } else { router.push(href);