-
{
- /**
- * Don't allow manual account number entry when there's a
- * filter.
- *
- * @todo: Change this to only call `handleChange()` when the
- * user presses Enter? Then it could validate that the entered
- * account index is in the filter.
- */
- if (filter) {
- return;
- }
+ {account === 0 ? (
+
Main Account
+ ) : (
+ <>
+
Sub-Account
- const value = Number(e.target.value);
- const valueLength = e.target.value.replace(/^0+/, '').length;
+
+
#
+
+ {
+ /**
+ * Don't allow manual account number entry when there's a
+ * filter.
+ *
+ * @todo: Change this to only call `handleChange()` when the
+ * user presses Enter? Then it could validate that the entered
+ * account index is in the filter.
+ */
+ if (filter) {
+ return;
+ }
- if (value > MAX_INDEX || valueLength > MAX_INDEX.toString().length) {
- return;
- }
- handleChange(value);
- }}
- style={{ width: `${inputCharWidth}ch` }}
- value={account ? account.toString().replace(/^0+/, '') : '0'} // Removes leading zeros (e.g. 00123 -> 123
- />
-
-
+ const value = Number(e.target.value);
+ const valueLength = e.target.value.replace(/^0+/, '').length;
+
+ if (value > MAX_INDEX || valueLength > MAX_INDEX.toString().length) {
+ return;
+ }
+ handleChange(value);
+ }}
+ style={{ width: `${inputCharWidth}ch` }}
+ value={account ? account.toString().replace(/^0+/, '') : '0'} // Removes leading zeros (e.g. 00123 -> 123
+ />
+