
extension Post {

    enum Mock {

        static func mockData(content: Content) -> [Post] {
            [
                Post(content: content,
                     id: "empty",
                     isDraft: true,
                     createdDate: .now,
                     startDate: .now,
                     endDate: nil,
                     tags: [],
                     german: .init(
                        content: content,
                        text: "Text"),
                     english: .init(
                        content: content,
                        text: "Text"),
                     linkedPage: nil),
                Post(
                    content: content,
                    id: "hike",
                    isDraft: false,
                    createdDate: .now,
                    startDate: .now,
                    endDate: nil,
                    tags: [
                        content.tags.first(where: { $0.identifier == "nature" })!,
                        content.tags.first(where: { $0.identifier == "sports" })!,
                        content.tags.first(where: { $0.identifier == "hiking" })!
                    ],
                    german: .init(
                        content: content,
                        title: "Eine Wanderung",
                        text: "Sehr schöne und einsame Tour von Oberau zum Krottenkopf. Abwechslungsreich und stellenweise fordernd, aufgrund der Länge und der Höhenmeter auch anstrengend."),
                    english: .init(
                        content: content,
                        title: "A hike",
                        text: "Very nice and solitary hike from Oberau to Krottenkopf. Challenging and rewarding, due to the length and height")
                ),
                Post(
                    content: content,
                    id: "hike2",
                    isDraft: true,
                    createdDate: .now,
                    startDate: .now.addingTimeInterval(-86400), endDate: .now,
                    tags: [
                        content.tags.first(where: { $0.identifier == "nature" })!,
                        content.tags.first(where: { $0.identifier == "sports" })!,
                        content.tags.first(where: { $0.identifier == "hiking" })!,
                        content.tags.first(where: { $0.identifier == "mountains" })!
                    ],
                    german: LocalizedPost(
                        content: content,
                        title: "Eine lange Wanderung",
                        text: "Sehr schöne und einsame Tour von Oberau zum Krottenkopf. Abwechslungsreich und stellenweise fordernd, aufgrund der Länge und der Höhenmeter auch anstrengend.",
                        images: [
                            content.files.first(where: { $0.identifier == "image1" })!,
                            content.files.first(where: { $0.identifier == "image2" })!,
                            content.files.first(where: { $0.identifier == "image3" })!,
                            content.files.first(where: { $0.identifier == "image4" })!
                        ]),
                    english: LocalizedPost(
                        content: content,
                        title: "A longer hike",
                        text: "Very nice and solitary hike from Oberau to Krottenkopf. Challenging and rewarding, due to the length and height.",
                        images: [
                            content.files.first(where: { $0.identifier == "image1" })!,
                            content.files.first(where: { $0.identifier == "image2" })!,
                            content.files.first(where: { $0.identifier == "image3" })!,
                            content.files.first(where: { $0.identifier == "image4" })!
                        ]))
            ]
        }

        static var empty: Post {
            Content.mock.posts.first(where: { $0.identifier == "empty" })!
        }

        static var hike: Post {
            Content.mock.posts.first(where: { $0.identifier == "hike" })!
        }

        static var hike2: Post {
            Content.mock.posts.first(where: { $0.identifier == "hike2" })!
        }
    }
}
