//
//  AccountFollowsViewController.swift
//  Tusker
//
//  Created by Shadowfacts on 1/18/23.
//  Copyright © 2023 Shadowfacts. All rights reserved.
//

import UIKit

class AccountFollowsViewController: SegmentedPageViewController<AccountFollowsViewController.Mode> {
    
    let accountID: String
    let mastodonController: MastodonController
    
    init(accountID: String, mastodonController: MastodonController) {
        self.accountID = accountID
        self.mastodonController = mastodonController
        
        super.init(pages: [.following, .followers]) { mode in
            AccountFollowsListViewController(accountID: accountID, mastodonController: mastodonController, mode: mode)
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

}

extension AccountFollowsViewController {
    enum Mode: SegmentedPageViewControllerPage {
        case following, followers
        
        var title: String {
            switch self {
            case .following:
                return "Following"
            case .followers:
                return "Followers"
            }
        }
        
        var segmentedControlTitle: String { title }
    }
}
