Use translations in a DS component story

This commit is contained in:
Belén Albeza 2024-08-30 15:45:52 +02:00
parent 8aaa04b1f8
commit 8feb5dabb0
4 changed files with 9 additions and 6 deletions

View file

@ -10,6 +10,7 @@
[app.main.style :as stl])
(:require
[app.common.math :as mth]
[app.util.i18n :as i18n :refer [tr]]
[rumext.v2 :as mf]))
(mf/defc loader-icon*
@ -40,11 +41,9 @@
h (or height (when (some? width) (mth/ceil (* width (/ 27 100)))) 27)
class (dm/str (or class "") " " (stl/css-case :wrapper true
:wrapper-overlay overlay))
title (or title (tr "labels.loading"))
props (mf/spread-props props {:class class})]
(assert title
(dm/str "You must provide an accesible name for the component"))
[:> "div" props
[:> loader-icon* {:title title
:width w

View file

@ -7,10 +7,10 @@ export default {
title: "Product/Loader",
component: Loader,
args: {
title: "Loading…",
overlay: false,
},
argTypes: {
title: { control: "text" },
width: { control: "number" },
height: { control: "number" },
overlay: { control: "boolean" },