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

<?import org.cryptomator.ui.controls.FontAwesome5IconView?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ButtonBar?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Region?>
<?import javafx.scene.layout.VBox?>
<VBox xmlns:fx="http://javafx.com/fxml"
	  xmlns="http://javafx.com/javafx"
	  fx:controller="org.cryptomator.ui.addvaultwizard.CreateNewVaultNameController"
	  prefWidth="450"
	  prefHeight="450"
	  spacing="12"
	  alignment="CENTER_LEFT">
	<padding>
		<Insets topRightBottomLeft="24"/>
	</padding>
	<children>
		<Region VBox.vgrow="ALWAYS"/>

		<VBox spacing="6">
			<Label text="%addvaultwizard.new.nameInstruction" labelFor="$textField"/>
			<TextField fx:id="textField" promptText="%addvaultwizard.new.namePrompt" HBox.hgrow="ALWAYS"/>
			<Label text="${controller.warningText}" wrapText="true" visible="${controller.showWarning}">
				<graphic>
					<FontAwesome5IconView glyph="EXCLAMATION_TRIANGLE"/>
				</graphic>
			</Label>
		</VBox>

		<Region VBox.vgrow="ALWAYS"/>

		<ButtonBar buttonMinWidth="120" buttonOrder="B+X">
			<buttons>
				<Button text="%generic.button.back" ButtonBar.buttonData="BACK_PREVIOUS" onAction="#back"/>
				<Button text="%generic.button.next" ButtonBar.buttonData="NEXT_FORWARD" onAction="#next" defaultButton="true" disable="${controller.invalidVaultName}"/>
			</buttons>
		</ButtonBar>
	</children>
</VBox>
