diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index e8d5eae..5237e4f 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -1,7 +1,7 @@ -import { useState, useEffect } from react -import { Link, useLocation } from react-router-dom -import api from @/services/api -import type { User } from @/types +import { useState, useEffect } from 'react' +import { Link, useLocation } from 'react-router-dom' +import api from '@/services/api' +import type { User } from '@/types' interface Props { user: User | null @@ -17,11 +17,11 @@ export default function Sidebar({ user, onLogout }: Props) { setUnreadCount(0) return } - api.get<{ count: number }>(/notifications/count) + api.get<{ count: number }>('/notifications/count') .then(({ data }) => setUnreadCount(data.count)) .catch(() => {}) const timer = setInterval(() => { - api.get<{ count: number }>(/notifications/count) + api.get<{ count: number }>('/notifications/count') .then(({ data }) => setUnreadCount(data.count)) .catch(() => {}) }, 30000) @@ -29,14 +29,14 @@ export default function Sidebar({ user, onLogout }: Props) { }, [user]) const links = user ? [ - { to: /, icon: ๐, label: ไปช่กจ็ }, - { to: /issues, icon: ๐, label: Issues }, - { to: /projects, icon: ๐, label: ้กน็ฎ }, - { to: /milestones, icon: ๐, label: ้็จ็ข }, - { to: /notifications, icon: ๐, label: `้็ฅ${unreadCount > 0 ? ` (${unreadCount})` : }` }, - { to: /monitor, icon: ๐ก, label: Monitor }, + { to: '/', icon: '๐', label: 'ไปช่กจ็' }, + { to: '/issues', icon: '๐', label: 'Issues' }, + { to: '/projects', icon: '๐', label: '้กน็ฎ' }, + { to: '/milestones', icon: '๐', label: '้็จ็ข' }, + { to: '/notifications', icon: '๐', label: '้็ฅ' + (unreadCount > 0 ? ' (' + unreadCount + ')' : '') }, + { to: '/monitor', icon: '๐ก', label: 'Monitor' }, ] : [ - { to: /monitor, icon: ๐ก, label: Monitor }, + { to: '/monitor', icon: '๐ก', label: 'Monitor' }, ] return ( @@ -46,7 +46,7 @@ export default function Sidebar({ user, onLogout }: Props) {