import Foundation

extension Tag {

    enum Mock {

        static func mockData(content: Content) -> [Tag] {
            [
                Tag(content: content,
                    id: "electronics",
                    german: .init(
                        content: content,
                        urlComponent: "elektronik",
                        name: "Elektronik",
                        linkPreview: .init(description: "Eine Beschreibung des Tags",
                                           image: content.files.first(where: { $0.identifier == "image2" })!),
                        originalUrl: "projects/electronics"
                    ),
                    english: .init(
                        content: content,
                        urlComponent: "electronics",
                        name: "Electronics",
                        linkPreview: .init(
                            description: "Some description of the tag",
                            image: content.files.first(where: { $0.identifier == "image1" })!),
                        originalUrl: "projects/electronics")
                   ),
                Tag(
                    content: content,
                    id: "nature",
                    german: .init(content: content, urlComponent: "natur", name: "Natur"),
                    english: .init(content: content, urlComponent: "nature", name: "Nature")
                ),
                Tag(
                    content: content,
                    id: "sports",
                    german: .init(content: content, urlComponent: "sport", name: "Sport"),
                    english: .init(content: content, urlComponent: "sports", name: "Sports")
                ),
                Tag(
                    content: content,
                    id: "hiking",
                    german: .init(content: content, urlComponent: "wandern", name: "Wandern"),
                    english: .init(content: content, urlComponent: "hiking", name: "Hiking")
                ),
                Tag(
                    content: content,
                    id: "mountains",
                    german: .init(content: content, urlComponent: "berge", name: "Berge"),
                    english: .init(content: content, urlComponent: "mountains", name: "Mountains")
                )
            ]
        }

        static var electronics: Tag {
            Content.mock.tags.first(where: { $0.identifier == "electronics" })!
        }
        
        static var nature: Tag {
            Content.mock.tags.first(where: { $0.identifier == "nature" })!
        }
        
        static var sports: Tag {
            Content.mock.tags.first(where: { $0.identifier == "sports" })!
        }
        
        static var hiking: Tag {
            Content.mock.tags.first(where: { $0.identifier == "hiking" })!
        }
        
        static var mountains: Tag {
            Content.mock.tags.first(where: { $0.identifier == "mountains" })!
        }
    }
}
