import 'package:flutter/material.dart';

import 'package:flutter/foundation.dart';
import '../../../core/models/sheet.dart';

/// A list tile displaying a single sheet's information.
///
/// Shows the sheet name and composer, with tap and long-press handlers.
class SheetListItem extends StatelessWidget {
  final Sheet sheet;
  final VoidCallback onTap;
  final VoidCallback onLongPress;

  const SheetListItem({
    super.key,
    required this.sheet,
    required this.onTap,
    required this.onLongPress,
  });

  @override
  Widget build(BuildContext context) {
    return ListTile(
      title: Text(sheet.name),
      subtitle: Text(sheet.composer),
      onTap: onTap,
      onLongPress: onLongPress,
      trailing: Visibility(
        visible: !kIsWeb && sheet.availableOffline,
        child: Icon(Icons.download_done, color: Colors.green),
      ),
    );
  }
}
