SpoolBuddyBottomNav.tsx 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import { NavLink } from 'react-router-dom';
  2. import { useTranslation } from 'react-i18next';
  3. const navItems = [
  4. {
  5. to: '/spoolbuddy',
  6. labelKey: 'spoolbuddy.nav.dashboard',
  7. fallback: 'Dashboard',
  8. icon: (
  9. <svg className="w-6 h-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
  10. <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" />
  11. </svg>
  12. ),
  13. },
  14. {
  15. to: '/spoolbuddy/ams',
  16. labelKey: 'spoolbuddy.nav.ams',
  17. fallback: 'AMS',
  18. icon: (
  19. <svg className="w-6 h-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
  20. <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" />
  21. </svg>
  22. ),
  23. },
  24. {
  25. to: '/spoolbuddy/write-tag',
  26. labelKey: 'spoolbuddy.nav.writeTag',
  27. fallback: 'Write',
  28. icon: (
  29. <svg className="w-6 h-6" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2}>
  30. <path strokeLinecap="round" strokeLinejoin="round" d="M8.288 15.038a5.25 5.25 0 017.424 0M5.106 11.856c3.807-3.808 9.98-3.808 13.788 0M1.924 8.674c5.565-5.565 14.587-5.565 20.152 0" />
  31. <path strokeLinecap="round" strokeLinejoin="round" d="M12.53 18.22l-.53.53-.53-.53a.75.75 0 011.06 0z" />
  32. </svg>
  33. ),
  34. },
  35. {
  36. to: '/spoolbuddy/settings',
  37. labelKey: 'spoolbuddy.nav.settings',
  38. fallback: 'Settings',
  39. icon: (
  40. <svg className="w-6 h-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
  41. <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
  42. <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
  43. </svg>
  44. ),
  45. },
  46. ];
  47. export function SpoolBuddyBottomNav() {
  48. const { t } = useTranslation();
  49. return (
  50. <nav className="h-14 bg-bambu-dark-secondary border-t border-bambu-dark-tertiary flex items-stretch shrink-0">
  51. {navItems.map((item) => (
  52. <NavLink
  53. key={item.to}
  54. to={item.to}
  55. end={item.to === '/spoolbuddy'}
  56. className={({ isActive }) =>
  57. `flex-1 flex flex-col items-center justify-center gap-1 transition-colors ${
  58. isActive
  59. ? 'text-bambu-green bg-bambu-dark'
  60. : 'text-white/50 hover:text-white/70 hover:bg-bambu-dark-tertiary'
  61. }`
  62. }
  63. >
  64. {item.icon}
  65. <span className="text-xs font-medium">{t(item.labelKey, item.fallback)}</span>
  66. </NavLink>
  67. ))}
  68. </nav>
  69. );
  70. }