import 'package:flutter/material.dart';
import 'package:syncrow_web/utils/color_manager.dart';

class SpaceWidget extends StatelessWidget {
  final String name;
  final Offset position;
  final VoidCallback onTap;

  const SpaceWidget({
    super.key,
    required this.name,
    required this.position,
    required this.onTap,
  });

  @override
  Widget build(BuildContext context) {
    return Positioned(
      left: position.dx,
      top: position.dy,
      child: GestureDetector(
        onTap: onTap,
        child: Container(
          padding: const EdgeInsets.all(8.0),
          decoration: BoxDecoration(
            color: ColorsManager.whiteColors,
            borderRadius: BorderRadius.circular(8),
            boxShadow: [
              BoxShadow(
                color: ColorsManager.lightGrayColor.withOpacity(0.5),
                spreadRadius: 5,
                blurRadius: 7,
                offset: const Offset(0, 3),
              ),
            ],
          ),
          child: Row(
            children: [
              const Icon(Icons.location_on, color: ColorsManager.spaceColor),
              const SizedBox(width: 8),
              Text(name, style: Theme.of(context).textTheme.bodyMedium),
            ],
          ),
        ),
      ),
    );
  }
}
