//
//  XVPersonalHeaderItemView.m
//  fastservice
//
//  Created by xuning on 4/26/25.
//  Copyright © 2025 FastService. All rights reserved.
//

#import "XVPersonalHeaderItemView.h"

@interface XVPersonalHeaderItemView()



@end

@implementation XVPersonalHeaderItemView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self setupUI];
    }
    return self;
}

- (void)setupUI {
    
    [self addSubview:self.titleLabel];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self).mas_offset(16);
        make.centerX.mas_equalTo(self);
    }];
    
    [self addSubview:self.numberLabel];
    [self.numberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self);
        make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_offset(6);
    }];
    
    [self addSubview:self.button];
    [self.button mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self);
        make.bottom.mas_equalTo(self).mas_offset(-10);
    }];
    
    [self.button setForceRightToLeft:1 forState:(UIControlStateNormal)];
    
}

- (UILabel *)titleLabel {
    if(_titleLabel == nil) {
        _titleLabel = [[UILabel alloc]initWithText:@"标题" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentCenter) fontSize:12];
    }
    return _titleLabel;
}


- (UILabel *)numberLabel {
    if(_numberLabel == nil) {
        _numberLabel = [[UILabel alloc]initWithText:@"0" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentCenter) fontSize:20];
        _numberLabel.font = [UIFont boldSystemFontOfSize:20];
    }
    return _numberLabel;
}

- (UIButton *)button {
    if (_button == nil) {
        _button = [[UIButton alloc]initWithTitle:@"" fontSize:12 titleColor:F_101010_COLOR normalImageName:@"if-simple-right" selectedImgName:@"if-simple-right" backgroundColor:[UIColor whiteColor]];
    }
    return _button;
}

@end
