//
//  ExportFormat.swift
//  PadelClub
//
//  Created by Razmig Sarkissian on 19/07/2024.
//

import Foundation

enum ExportFormat: Int, Identifiable, CaseIterable {
    var id: Int { self.rawValue }
    
    case rawText
    case csv
    
    var suffix: String {
        switch self {
        case .rawText:
            return "txt"
        case .csv:
            return "csv"
        }
    }
    
    func separator() -> String {
        switch self {
        case .rawText:
            return " "
        case .csv:
            return ";"
        }
    }
    
    func newLineSeparator(_ count: Int = 1) -> String {
        return Array(repeating: "\n", count: count).joined()
    }
}
