diff options
Diffstat (limited to 'src/FundLab.Web/App.fs')
| -rw-r--r-- | src/FundLab.Web/App.fs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/FundLab.Web/App.fs b/src/FundLab.Web/App.fs new file mode 100644 index 0000000..630a8e9 --- /dev/null +++ b/src/FundLab.Web/App.fs @@ -0,0 +1,41 @@ +module FundLab.Web + +open Elmish +open Elmish.React +open Feliz + +type Model = + { + hasFund: bool + } + +type Msg = + | CreateFundRequested + +let init () = + { hasFund = false } + +let update message model = + match message with + | CreateFundRequested -> model + +let view model dispatch = + Html.main [ + prop.className "empty-state" + prop.children [ + Html.p [ prop.className "eyebrow"; prop.text "FUND LAB" ] + Html.h1 "尚未创建基金" + Html.p "先创建一支人民币模拟基金,再选择基金代码和持仓金额。" + Html.p (if model.hasFund then "已创建基金" else "尚未选择投资") + Html.button [ + prop.className "primary-action" + prop.text "创建基金" + prop.onClick (fun _ -> dispatch CreateFundRequested) + ] + ] + ] + +let start () = + Program.mkSimple init update view + |> Program.withReactSynchronous "fund-lab-root" + |> Program.run |
