import Foundation
import UIKit

struct GIF: Codable, Identifiable, Equatable {
    let id: UUID
    let urlString: String
    let createdAt: Date
    
    var url: URL? {
        return URL(string: urlString)
    }
    
    init(urlString: String) {
        self.id = UUID()
        self.urlString = urlString
        self.createdAt = Date()
    }
    
    static func == (lhs: GIF, rhs: GIF) -> Bool {
        return lhs.id == rhs.id
    }
}