SpoolBuddyBottomNav.tsx 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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/inventory',
  37. labelKey: 'spoolbuddy.nav.inventory',
  38. fallback: 'Inventory',
  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="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4" />
  42. </svg>
  43. ),
  44. },
  45. {
  46. to: '/spoolbuddy/settings',
  47. labelKey: 'spoolbuddy.nav.settings',
  48. fallback: 'Settings',
  49. icon: (
  50. <svg className="w-6 h-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
  51. <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" />
  52. <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
  53. </svg>
  54. ),
  55. },
  56. ];
  57. export function SpoolBuddyBottomNav() {
  58. const { t } = useTranslation();
  59. return (
  60. <nav className="h-14 bg-bambu-dark-secondary border-t border-bambu-dark-tertiary flex items-stretch shrink-0">
  61. {navItems.map((item) => (
  62. <NavLink
  63. key={item.to}
  64. to={item.to}
  65. end={item.to === '/spoolbuddy'}
  66. className={({ isActive }) =>
  67. `flex-1 flex flex-col items-center justify-center gap-1 transition-colors ${
  68. isActive
  69. ? 'text-bambu-green bg-bambu-dark'
  70. : 'text-white/50 hover:text-white/70 hover:bg-bambu-dark-tertiary'
  71. }`
  72. }
  73. >
  74. {item.icon}
  75. <span className="text-xs font-medium">{t(item.labelKey, item.fallback)}</span>
  76. </NavLink>
  77. ))}
  78. </nav>
  79. );
  80. }