import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

const String settingsAssetPanelLeft =
    'lib/assets/monitoring/box_bg_460x905.png';
const String settingsAssetPanelMain =
    'lib/assets/monitoring/box_bg_674x509.png';
const String settingsAssetButton =
    'lib/assets/monitoring/frame_button_324x164.png';

class SettingsPanelFrame extends StatelessWidget {
  const SettingsPanelFrame({
    super.key,
    required this.child,
    required this.padding,
    required this.backgroundAsset,
  });

  final Widget child;
  final EdgeInsetsGeometry padding;
  final String backgroundAsset;

  @override
  Widget build(BuildContext context) {
    return Container(
      width: double.infinity,
      height: double.infinity,
      padding: padding,
      decoration: BoxDecoration(
        image: DecorationImage(
          image: AssetImage(backgroundAsset),
          fit: BoxFit.fill,
        ),
      ),
      child: child,
    );
  }
}

BoxDecoration settingsButtonDecoration({bool active = false}) {
  return BoxDecoration(
    image: const DecorationImage(
      image: AssetImage(settingsAssetButton),
      fit: BoxFit.fill,
    ),
    boxShadow: active
        ? [
            BoxShadow(
              color: const Color(0xFF45CFFF).withValues(alpha: 0.3),
              blurRadius: 18.r,
              spreadRadius: 1.r,
            ),
          ]
        : null,
  );
}
