1
+ package com.ifeel.components.ui.components.generic.card
2
+
3
+ import androidx.compose.foundation.Image
4
+ import androidx.compose.foundation.background
5
+ import androidx.compose.foundation.border
6
+ import androidx.compose.foundation.layout.Row
7
+ import androidx.compose.foundation.layout.padding
8
+ import androidx.compose.foundation.shape.RoundedCornerShape
9
+ import androidx.compose.material3.Text
10
+ import androidx.compose.runtime.Composable
11
+ import androidx.compose.ui.Alignment
12
+ import androidx.compose.ui.Modifier
13
+ import androidx.compose.ui.draw.clip
14
+ import androidx.compose.ui.res.painterResource
15
+ import androidx.compose.ui.tooling.preview.Preview
16
+ import androidx.compose.ui.unit.dp
17
+ import com.ifeel.components.R
18
+ import com.ifeel.components.ui.theme.IfeelComponentsTheme
19
+ import com.ifeel.components.ui.theme.color_brand_secondary_200
20
+ import com.ifeel.components.ui.theme.color_danger_100
21
+ import com.ifeel.components.ui.theme.color_text_700
22
+ import com.ifeel.components.ui.theme.text.BodyTextStyle
23
+
24
+ private val cardShape = RoundedCornerShape (10 .dp)
25
+
26
+ @Composable
27
+ fun WarningCard (text : String , modifier : Modifier = Modifier ) {
28
+ Row (
29
+ modifier = modifier
30
+ .border(
31
+ width = 1 .dp,
32
+ color = color_brand_secondary_200,
33
+ shape = cardShape
34
+ )
35
+ .clip(shape = cardShape)
36
+ .background(color = color_danger_100)
37
+ .padding(12 .dp)
38
+ ) {
39
+ Image (
40
+ painter = painterResource(id = R .drawable.warning_card_ic),
41
+ contentDescription = null ,
42
+ modifier = Modifier
43
+ .align(Alignment .CenterVertically )
44
+ .padding(end = 8 .dp),
45
+ )
46
+
47
+ Text (
48
+ text = text,
49
+ style = BodyTextStyle .Body14Regular .toTextStyle(),
50
+ color = color_text_700
51
+ )
52
+ }
53
+ }
54
+
55
+ @Preview(showBackground = true )
56
+ @Composable
57
+ private fun WarningCardPreview () {
58
+ IfeelComponentsTheme {
59
+ WarningCard (
60
+ modifier = Modifier .padding(20 .dp),
61
+ text = " Contraseña o email incorrectos. Por motivos de seguridad, después de 10 intentos fallidos tu acceso se bloqueará durante 60 minutos."
62
+ )
63
+ }
64
+ }
0 commit comments