<?xml version="1.0" encoding="UTF-8"?>

<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import com.sparrowwallet.sparrow.control.TransactionsTreeTable?>
<?import javafx.geometry.Insets?>
<?import com.sparrowwallet.sparrow.control.BalanceChart?>
<?import javafx.scene.chart.NumberAxis?>
<?import tornadofx.control.Form?>
<?import tornadofx.control.Fieldset?>
<?import tornadofx.control.Field?>
<?import com.sparrowwallet.sparrow.control.CoinLabel?>
<?import com.sparrowwallet.sparrow.control.FiatLabel?>
<?import com.sparrowwallet.sparrow.control.CopyableLabel?>
<?import org.controlsfx.glyphfont.Glyph?>

<BorderPane stylesheets="@transactions.css, @wallet.css, @../general.css" styleClass="wallet-pane" xmlns="http://javafx.com/javafx/10.0.2-internal" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.sparrowwallet.sparrow.wallet.TransactionsController">
    <center>
        <VBox spacing="10">
            <padding>
                <Insets left="25.0" right="25.0" top="25.0" bottom="25.0" />
            </padding>
            <GridPane styleClass="send-form" hgap="10.0" vgap="10.0">
                <columnConstraints>
                    <ColumnConstraints percentWidth="50" />
                    <ColumnConstraints percentWidth="50" />
                </columnConstraints>
                <rowConstraints>
                    <RowConstraints />
                </rowConstraints>
                <Form GridPane.columnIndex="0" GridPane.rowIndex="0">
                    <Fieldset inputGrow="SOMETIMES" text="Transactions" styleClass="header">
                        <Field text="Balance:">
                            <CoinLabel fx:id="balance"/><Region HBox.hgrow="ALWAYS"/><FiatLabel fx:id="fiatBalance" minWidth="110" />
                        </Field>
                        <Field text="Mempool:">
                            <CoinLabel fx:id="mempoolBalance" /><Region HBox.hgrow="ALWAYS"/><FiatLabel fx:id="fiatMempoolBalance" minWidth="110" />
                        </Field>
                        <Field text="Transactions:">
                            <CopyableLabel fx:id="transactionCount" />
                            <Button fx:id="exportCsv" maxHeight="25" onAction="#exportCSV" translateY="-1" styleClass="icon-button">
                                <graphic>
                                    <Glyph fontFamily="Font Awesome 5 Free Solid" icon="ARROW_CIRCLE_DOWN" fontSize="12" />
                                </graphic>
                                <tooltip>
                                    <Tooltip text="Export transactions as CSV" />
                                </tooltip>
                            </Button>
                        </Field>
                    </Fieldset>
                </Form>
                <BalanceChart fx:id="balanceChart" animated="false" legendVisible="false" verticalGridLinesVisible="false" GridPane.columnIndex="1" GridPane.rowIndex="0">
                    <xAxis>
                        <NumberAxis side="BOTTOM" forceZeroInRange="false" minorTickVisible="false" />
                    </xAxis>
                    <yAxis>
                        <NumberAxis side="LEFT" />
                    </yAxis>
                </BalanceChart>
            </GridPane>
            <TransactionsTreeTable fx:id="transactionsTable" VBox.vgrow="ALWAYS" />
        </VBox>
    </center>
</BorderPane>
