//
//  ShareButton.swift
//  SelfieCam
//
//  Created by Matt Bruce on 1/4/26.
//

import SwiftUI
import Bedrock

// MARK: - Share Button

struct ShareButton: View {
    let photo: UIImage
    @State private var isShareSheetPresented = false

    var body: some View {
        Button {
            isShareSheetPresented = true
        } label: {
            Image(systemName: "square.and.arrow.up")
                .font(.system(size: 20, weight: .medium))
                .foregroundStyle(.white)
                .frame(maxWidth: .infinity, maxHeight: .infinity)
        }
        .accessibilityLabel("Share photo")
        .sheet(isPresented: $isShareSheetPresented) {
            ShareSheet(activityItems: [photo])
        }
    }
}
