<wxs src="../../utils/tools.wxs" module="tools" />
<view class="garden-page">
    <view class="page-header with-banner">
        <view class="header-content">
            <text class="date-text">{{dateString}}</text>
            <view class="greeting-row">
                <text class="greeting-main">{{greeting}}，园长</text>
            </view>
            <text class="subtitle">今天也要好好照顾它们哦</text>
        </view>
    </view>

    <view class="banner-container">
        <image src="https://images.unsplash.com/photo-1585320806297-9794b3e4eeae?w=800" class="garden-banner" mode="aspectFill" />
        <view class="banner-overlay">
            <text class="count-tag">共养护 {{plants.length}} 盆植物</text>
        </view>
    </view>

    <view class="garden-list-wrapper">
        <scroll-view scroll-y class="garden-list-container" enhanced show-scrollbar="{{false}}" bindscrolltolower="onScrollLower">
            <view class="plant-grid">
                <view wx:for="{{plants}}" wx:key="id" class="plant-card" bindtap="navigateToDetail" data-id="{{item.id}}">
                    <view class="plant-image-container">
                        <t-image src="{{tools.resolvePath(item.images[0])}}" mode="aspectFill" width="100%" height="100%" />
                        <view class="days-badge">{{item.daysPlanted}}天</view>
                    </view>
                    <view class="plant-info">
                        <text class="plant-name">{{item.name}}</text>
                        <view class="status-wrap">
                            <text class="status">生长中</text>
                        </view>
                    </view>
                </view>
            </view>
            <view style="height: 100rpx;"></view>
        </scroll-view>
    </view>

  <!-- Custom Floating Action Button -->
  <view class="floating-add-btn" bindtap="navigateToAdd">
    <t-icon name="add" size="40rpx" color="#FFF" />
    <text>添加植物</text>
  </view>
</view>
