summaryrefslogtreecommitdiff
path: root/bs5/universal/native/shared/ServerActionWithFormDataFormAction.re
blob: fe80f98f868f232365a509c1a969588dbf7e154d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[@react.component]
let make = () => {
  <form className={Cx.make([Theme.text(Theme.Color.Gray4)])}>
    <input
      name="name"
      className="w-full mb-2 font-sans border border-gray-300 py-2 px-4 rounded-md bg-white text-gray-900 placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition duration-200"
      placeholder="Name"
    />
    <button
      formAction={
        switch%platform () {
        | Server => `Function(ServerFunctions.formDataFunction)
        | Client => ""
        }
      }
      className="font-mono border-2 py-1 px-2 rounded-lg bg-yellow-950 border-yellow-700 text-yellow-200 hover:bg-yellow-800"
      type_="submit">
      {React.string("Send Form Data")}
    </button>
  </form>;
};