Flask API/admin backend, aiogram bot with delivery/pickup FSM flows, monobank payment integration, and a Vite/React Telegram Mini App for menu browsing and cart management.
27 lines
828 B
TypeScript
27 lines
828 B
TypeScript
export type Tab = "menu" | "cart" | "contacts";
|
|
|
|
interface Props {
|
|
active: Tab;
|
|
cartCount: number;
|
|
onChange: (tab: Tab) => void;
|
|
}
|
|
|
|
const TABS: { id: Tab; icon: string; label: string }[] = [
|
|
{ id: "menu", icon: "🍽", label: "Меню" },
|
|
{ id: "cart", icon: "🛒", label: "Кошик" },
|
|
{ id: "contacts", icon: "📞", label: "Контакти" },
|
|
];
|
|
|
|
export function BottomNav({ active, cartCount, onChange }: Props) {
|
|
return (
|
|
<nav className="bottom-nav">
|
|
{TABS.map((tab) => (
|
|
<button key={tab.id} className={active === tab.id ? "active" : ""} onClick={() => onChange(tab.id)}>
|
|
<span className="icon">{tab.icon}</span>
|
|
{tab.label}
|
|
{tab.id === "cart" && cartCount > 0 && <span className="badge">{cartCount}</span>}
|
|
</button>
|
|
))}
|
|
</nav>
|
|
);
|
|
}
|