diff --git a/src/layout.tsx b/src/layout.tsx index 3a4cb3e..b0b97ac 100644 --- a/src/layout.tsx +++ b/src/layout.tsx @@ -1,37 +1,61 @@ -import { Home, Bell, FileText, User, Menu } from 'lucide-react'; -import { useState } from 'react'; +import { Home, Bell, FileText, User, Menu, CirclePlus } from 'lucide-react'; +import { useMemo, useState } from 'react'; import { Button } from './components/ui/button'; +import { useAppStore } from './store'; +import { useShallow } from 'zustand/react/shallow'; + +function AccountDisplay({ info }: { info: { name: string; balance: string } | null | undefined }) { + const name = useMemo(() => info?.name ?? 'No account selected', [info]); + const balance = useMemo(() => info?.balance ?? '--', [info]); + return ( + <> +

{name}

+

${balance}

+ + ); +} function TopNavigation() { - const [isMenuOpen, setIsMenuOpen] = useState(false); + const { accounts, selectedAccountId } = useAppStore(useShallow((state) => ({ accounts: state.accounts, selectedAccountId: state.selectedAccountId }))); + + const selectedAccount = accounts.find((account) => account.id === selectedAccountId); + return (
-

Cisko bank

-

$35,500

+
-
); } +type BottomNavigationButtonProps = { + icon: React.ComponentType<{ className?: string; fill?: string }>; + label?: string; + isSelected?: boolean; +}; + +function BottomNavigationButton({ icon: Icon, label, isSelected }: BottomNavigationButtonProps) { + return ( + + ); +} + function BottomNavigation() { return ( -
- - - - +
+ + +
+ +
+ +
); }