view LazyBear/Views/Search/CompanyList.swift @ 358:280cbc5653b5

SearchView implemented
author Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
date Fri, 16 Apr 2021 17:03:48 +0200
parents 80bfa88c6b0f
children db8bc3ed526a
line wrap: on
line source

//
//  CompanyList.swift
//  LazyBear
//
//  Created by Dennis Concepción Martín on 3/4/21.
//

import SwiftUI

struct CompanyList: View {
    var searchResult: [SearchResponse]
    
    var body: some View {
        List(searchResult, id: \.self) { company in
            SearchedCompanyItem(company: company)
        }
        .listStyle(GroupedListStyle())
    }
}

struct CompanyList_Previews: PreviewProvider {
    static var previews: some View {
        CompanyList(searchResult: [SearchResponse(currency: "USD", region: "US", securityName: "aaple inc", symbol: "aapl"), SearchResponse(currency: "USD", region: "US", securityName: "aaple inc", symbol: "aapl"), SearchResponse(currency: "USD", region: "US", securityName: "aaple inc", symbol: "aapl"), SearchResponse(currency: "USD", region: "US", securityName: "aaple inc", symbol: "aapl"), SearchResponse(currency: "USD", region: "US", securityName: "aaple inc", symbol: "aapl")])
    }
}