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

class CollaboraFrame extends StatefulWidget {
  final Uri editUrl;

  const CollaboraFrame({super.key, required this.editUrl});

  @override
  State<CollaboraFrame> createState() => _CollaboraFrameState();
}

class _CollaboraFrameState extends State<CollaboraFrame> {
  @override
  Widget build(BuildContext context) {
    if (kIsWeb) {
      return HtmlElementView(
        viewType: 'collabora-iframe',
        onPlatformViewCreated: (int viewId) {
          // On Web, create iframe
          // For simplicity, placeholder
        },
      );
    } else {
      return Container(
        color: Colors.grey,
        child: const Center(
          child: Text('Collabora iframe not supported on this platform'),
        ),
      );
    }
  }
}
