import SwiftUI struct TopViewImage: View { let image: String let shadow: CGFloat let lineWidth: CGFloat var body: some View { Image(image) .resizable() .aspectRatio(1, contentMode: .fit) .clipShape(Circle()) .overlay { Circle().stroke(.gray, lineWidth: lineWidth) } .shadow(radius: shadow) .padding(lineWidth) } } struct TopViewImage_Previews: PreviewProvider { static var previews: some View { TopViewImage( image: "Cover", shadow: 5, lineWidth: 2) .previewLayout(.fixed(width: 150, height: 150)) } }