AI store generator for ecommerce, Malaysia first. Laravel 13 + React + TypeScript.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import { Link } from '@inertiajs/react';
  2. import DiscountCodeController from '@/actions/App/Http/Controllers/DiscountCodeController';
  3. import OrderController from '@/actions/App/Http/Controllers/OrderController';
  4. import ProductController from '@/actions/App/Http/Controllers/ProductController';
  5. import StoreController from '@/actions/App/Http/Controllers/StoreController';
  6. import StoreSettingsController from '@/actions/App/Http/Controllers/StoreSettingsController';
  7. import { cn } from '@/lib/utils';
  8. type Tab = 'design' | 'products' | 'orders' | 'discounts' | 'settings';
  9. /** The tabs at the top of every page of one store. */
  10. export default function StoreNav({
  11. slug,
  12. current,
  13. }: {
  14. slug: string;
  15. current: Tab;
  16. }) {
  17. const tabs: { key: Tab; label: string; href: string }[] = [
  18. {
  19. key: 'design',
  20. label: 'Design',
  21. href: StoreController.show.url(slug),
  22. },
  23. {
  24. key: 'products',
  25. label: 'Products',
  26. href: ProductController.index.url(slug),
  27. },
  28. {
  29. key: 'orders',
  30. label: 'Orders',
  31. href: OrderController.index.url(slug),
  32. },
  33. {
  34. key: 'discounts',
  35. label: 'Discounts',
  36. href: DiscountCodeController.index.url(slug),
  37. },
  38. {
  39. key: 'settings',
  40. label: 'Settings',
  41. href: StoreSettingsController.edit.url(slug),
  42. },
  43. ];
  44. return (
  45. <nav aria-label="Store" className="flex gap-1 border-b">
  46. {tabs.map((tab) => (
  47. <Link
  48. key={tab.key}
  49. href={tab.href}
  50. aria-current={tab.key === current ? 'page' : undefined}
  51. className={cn(
  52. '-mb-px border-b-2 px-3 py-2 text-sm font-medium transition-colors',
  53. tab.key === current
  54. ? 'border-foreground text-foreground'
  55. : 'border-transparent text-muted-foreground hover:text-foreground',
  56. )}
  57. >
  58. {tab.label}
  59. </Link>
  60. ))}
  61. </nav>
  62. );
  63. }