@@ -19,11 +19,13 @@ import com.threegap.bitnagil.designsystem.BitnagilTheme
1919import com.threegap.bitnagil.designsystem.R
2020import com.threegap.bitnagil.designsystem.component.atom.BitnagilIcon
2121import com.threegap.bitnagil.designsystem.modifier.clickableWithoutRipple
22- import com.threegap.bitnagil.presentation.home.model.RoutineUiModel
2322
2423@Composable
2524fun RoutineItem (
26- routine : RoutineUiModel ,
25+ name : String ,
26+ isCompleted : Boolean ,
27+ subRoutineNames : List <String >,
28+ subRoutineIsCompleted : List <Boolean >,
2729 onRoutineToggle : () -> Unit ,
2830 onSubRoutineToggle : (Int ) -> Unit ,
2931 modifier : Modifier = Modifier ,
@@ -48,31 +50,31 @@ fun RoutineItem(
4850 verticalAlignment = Alignment .CenterVertically ,
4951 ) {
5052 Text (
51- text = routine. name,
53+ text = name,
5254 style = BitnagilTheme .typography.body1SemiBold,
5355 color = BitnagilTheme .colors.coolGray10,
5456 modifier = Modifier .weight(1f ),
5557 )
5658
5759 BitnagilIcon (
58- id = if (routine. isCompleted) R .drawable.ic_check_circle else R .drawable.ic_check_default,
60+ id = if (isCompleted) R .drawable.ic_check_circle else R .drawable.ic_check_default,
5961 tint = null ,
6062 modifier = Modifier
6163 .padding(start = 10 .dp)
6264 .size(28 .dp),
6365 )
6466 }
6567
66- if (routine. subRoutineNames.isNotEmpty()) {
68+ if (subRoutineNames.isNotEmpty()) {
6769 HorizontalDivider (
6870 thickness = 1 .dp,
6971 color = BitnagilTheme .colors.coolGray97,
7072 modifier = Modifier .padding(vertical = 10 .dp),
7173 )
7274
7375 SubRoutinesItem (
74- subRoutineNames = routine. subRoutineNames,
75- subRoutineCompleteYn = routine. subRoutineIsCompleted,
76+ subRoutineNames = subRoutineNames,
77+ subRoutineCompleteYn = subRoutineIsCompleted,
7678 onSubRoutineToggle = { index -> onSubRoutineToggle(index) },
7779 )
7880 }
@@ -83,17 +85,10 @@ fun RoutineItem(
8385@Composable
8486private fun RoutineItemPreview () {
8587 RoutineItem (
86- routine = RoutineUiModel (
87- id = " uuid1" ,
88- name = " 개운하게 일어나기" ,
89- repeatDays = emptyList(),
90- executionTime = " 20:30:00" ,
91- routineDate = " 2025-08-15" ,
92- isCompleted = false ,
93- subRoutineNames = listOf (" 물 마시기" , " 스트레칭하기" , " 심호흡하기" ),
94- subRoutineIsCompleted = listOf (true , false , true ),
95- recommendedRoutineType = null ,
96- ),
88+ name = " 개운하게 일어나기" ,
89+ isCompleted = false ,
90+ subRoutineNames = listOf (" 물 마시기" , " 스트레칭하기" , " 심호흡하기" ),
91+ subRoutineIsCompleted = listOf (true , false , true ),
9792 onRoutineToggle = { },
9893 onSubRoutineToggle = { _ -> },
9994 )
@@ -103,17 +98,10 @@ private fun RoutineItemPreview() {
10398@Composable
10499private fun NoneSubRoutineRoutineItemPreview () {
105100 RoutineItem (
106- routine = RoutineUiModel (
107- id = " uuid1" ,
108- name = " 개운하게 일어나기" ,
109- repeatDays = emptyList(),
110- executionTime = " 20:30:00" ,
111- routineDate = " 2025-08-15" ,
112- isCompleted = false ,
113- subRoutineNames = emptyList(),
114- subRoutineIsCompleted = emptyList(),
115- recommendedRoutineType = null ,
116- ),
101+ name = " 개운하게 일어나기" ,
102+ isCompleted = false ,
103+ subRoutineNames = emptyList(),
104+ subRoutineIsCompleted = emptyList(),
117105 onRoutineToggle = {},
118106 onSubRoutineToggle = { _ -> },
119107 )
0 commit comments