import SwiftUI

struct FloatingCreateButton: View {
    let action: () -> Void

    var body: some View {
        Button(action: action) {
            Image(systemName: "plus")
                .font(.title2.bold())
                .foregroundStyle(.white)
                .frame(width: 56, height: 56)
        }
        .glassEffect(.regular.tint(.blue).interactive())
        .accessibilityLabel("Create")
        .padding(.trailing, 20)
        .padding(.bottom, 20)
    }
}

struct ExpandableActionMenu<Content: View>: View {
    @Binding var isExpanded: Bool
    @ViewBuilder let content: () -> Content

    var body: some View {
        VStack(alignment: .trailing, spacing: 10) {
            if isExpanded {
                content()
            }

            Button {
                withAnimation(.snappy) {
                    isExpanded.toggle()
                }
            } label: {
                Image(systemName: isExpanded ? "xmark" : "wrench.and.screwdriver")
                    .font(.body)
                    .frame(width: 40, height: 40)
            }
            .buttonStyle(.glass)
            .accessibilityLabel("Actions")
            .accessibilityIdentifier("action-menu-toggle")
            .accessibilityValue(isExpanded ? "expanded" : "collapsed")
        }
        .padding(.trailing, 20)
        .padding(.bottom, 20)
    }
}
