import 'package:hub/features/storage/index.dart';
import 'package:share_plus/share_plus.dart';

class ShareUtil {
  static Future<void> showShare(payload) async {
    final cliName = await StorageHelper().get(ProfileStorageKey.clientName.key);
    final cliUUID = await StorageHelper().get(ProfileStorageKey.clientUUID.key);

    for (var i = 0; i < payload['convites'].length; i++) {
      await Share.share('''
Olá, \*${payload['convites'][i]['VTE_NOME']}\*! Você foi convidado para \*$cliName\*.

\*Validade do Convite\*:
- Início: ${payload['convites'][i]['VAW_DTINICIO']}
- Fim: ${payload['convites'][i]['VAW_DTFIM']}

URL do Convite: https://visita.freaccess.com.br/${payload['convites'][i]['VAW_ID']}/$cliUUID/${payload['convites'][i]['VAW_CHAVE']}
''');
    }
  }
}
