Commit
•
69739b2
1
Parent(s):
0d0d5bb
docs: `code_display` doc, attributes, and story
Browse files
lib/medical_transcription_web/components/components.ex
CHANGED
@@ -175,6 +175,12 @@ defmodule MedicalTranscriptionWeb.Components do
|
|
175 |
"""
|
176 |
end
|
177 |
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
def code_display(assigns) do
|
179 |
~H"""
|
180 |
<div class="py-4 text-sm flex flex-col gap-1 font-secondary text-type-black-primary rounded">
|
|
|
175 |
"""
|
176 |
end
|
177 |
|
178 |
+
attr :code, :string, required: true
|
179 |
+
attr :label, :string, required: true
|
180 |
+
|
181 |
+
@doc """
|
182 |
+
Displays a single code and its description.
|
183 |
+
"""
|
184 |
def code_display(assigns) do
|
185 |
~H"""
|
186 |
<div class="py-4 text-sm flex flex-col gap-1 font-secondary text-type-black-primary rounded">
|
storybook/components/code_display.story.exs
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
defmodule MedicalTranscriptionWeb.Storybook.CodeDisplay do
|
2 |
+
use PhoenixStorybook.Story, :component
|
3 |
+
|
4 |
+
def function, do: &MedicalTranscriptionWeb.Components.code_display/1
|
5 |
+
|
6 |
+
def variations do
|
7 |
+
[
|
8 |
+
%Variation{
|
9 |
+
id: :default,
|
10 |
+
attributes: %{
|
11 |
+
code: "74685",
|
12 |
+
label: "Coronary artery anomaly"
|
13 |
+
}
|
14 |
+
}
|
15 |
+
]
|
16 |
+
end
|
17 |
+
end
|