kit

Context menu

Built revision v17.10.0

React
Topics

Human support

Bring a missing role, layout, or state, or a rendering against the standard, to the session working on kit. Name the package and the entry.

Context menu

An invoice
Source
module Menu = KitReact.Menu

@react.component
let make = () =>
  <details>
    <summary> {React.string("An invoice")} </summary>
    <KitReact.Roles.Row
      subject={React.string("Oakmere Primary School")}
      subjectHref={"#role-context-menu"}
      facts=[{key: "kind", content: Words([KitReact.Words.Text("Invoice")]), props: {}}, {key: "amount", content: Words([KitReact.Words.Amount(KitReact.Amount.money(Specimen_Reader.reader, ~currency="GBP", ~amount="84.00"))]), props: {}}]
      actions=[
        KitReact.Roles.Row.SecondaryAction({children: React.string("Send reminder")}),
        KitReact.Roles.Row.ActionMenu(KitReact.Roles.ActionMenu.role({
          id: "role-context-menu-row-invoice",
          label: "More actions for this invoice",
          groups: [
            {
              items: [
                Menu.Item({name: "Duplicate", icon: KitReact.Icons.iconCopy}),
                Menu.Item({
                  name: "Archive",
                  icon: KitReact.Icons.iconArchive,
                  reason: [KitReact.Words.Text("Only the invoice's owner can archive it.")],
                }),
              ],
            },
            {items: [Menu.Destructive({name: "Delete invoice", icon: KitReact.Icons.iconTrash})]},
          ],
        })),
      ]
    />
  </details>