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.

store-nav.tsx 1.5KB

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