import 'package:flutter/material.dart';

import 'package:pshared/models/currency.dart';
import 'package:pshared/utils/currency.dart';

import 'package:pweb/pages/dashboard/buttons/balance/add/constants.dart';
import 'package:pweb/utils/text_field_styles.dart';

import 'package:pweb/generated/i18n/app_localizations.dart';


class LedgerFields extends StatelessWidget {
  final Currency currency;
  final ValueChanged<Currency?>? onCurrencyChanged;

  const LedgerFields({
    super.key,
    required this.currency,
    required this.onCurrencyChanged,
  });

  @override
  Widget build(BuildContext context) => DropdownButtonFormField<Currency>(
    initialValue: currency,
    decoration: getInputDecoration(context, AppLocalizations.of(context)!.currency, true),
    items: [
      DropdownMenuItem(
        value: ledgerCurrencyDefault,
        child: Text(currencyCodeToString(ledgerCurrencyDefault)),
      ),
    ],
    onChanged: onCurrencyChanged,
  );
}
