diff --git a/assets/javascripts/discourse/components/hledger-account-cell.gjs b/assets/javascripts/discourse/components/hledger-account-cell.gjs new file mode 100644 index 0000000..ef4b4c9 --- /dev/null +++ b/assets/javascripts/discourse/components/hledger-account-cell.gjs @@ -0,0 +1,17 @@ +import dConcatClass from "discourse/ui-kit/helpers/d-concat-class"; +import { depthClass } from "../lib/hledger-report"; + +const HledgerAccountCell = ; + +export default HledgerAccountCell; diff --git a/assets/javascripts/discourse/components/hledger-dashboard.gjs b/assets/javascripts/discourse/components/hledger-dashboard.gjs index c0c48d0..93ec24c 100644 --- a/assets/javascripts/discourse/components/hledger-dashboard.gjs +++ b/assets/javascripts/discourse/components/hledger-dashboard.gjs @@ -7,8 +7,9 @@ import { eq } from "discourse/truth-helpers"; import DButton from "discourse/ui-kit/d-button"; import DConditionalLoadingSpinner from "discourse/ui-kit/d-conditional-loading-spinner"; import DDatePicker from "discourse/ui-kit/d-date-picker"; -import dConcatClass from "discourse/ui-kit/helpers/d-concat-class"; import { i18n } from "discourse-i18n"; +import { amountText } from "../lib/hledger-report"; +import HledgerAccountCell from "./hledger-account-cell"; const REPORT_IDS = ["accounts", "balance_sheet", "income_statement", "equity"]; @@ -114,14 +115,6 @@ export default class HledgerDashboard extends Component { } } - amountText(amounts) { - return (amounts || []).map((amount) => amount.display).join(", "); - } - - depthClass(depth) { - return `--depth-${Math.min(depth || 0, 3)}`; - } -