@@ -17,19 +17,22 @@ import androidx.compose.foundation.shape.RoundedCornerShape
1717import androidx.compose.runtime.Composable
1818import androidx.compose.runtime.LaunchedEffect
1919import androidx.compose.runtime.getValue
20+ import androidx.compose.ui.Alignment
2021import androidx.compose.ui.Modifier
2122import androidx.compose.ui.draw.clip
2223import androidx.compose.ui.draw.shadow
2324import androidx.compose.ui.unit.dp
2425import androidx.hilt.navigation.compose.hiltViewModel
2526import androidx.lifecycle.compose.collectAsStateWithLifecycle
2627import coil.compose.AsyncImage
27- import team.retum.employment.model.CompanyItem
2828import team.retum.employment.viewmodel.EmploymentDetailViewModel
2929import team.retum.jobisdesignsystemv2.appbar.JobisSmallTopAppBar
3030import team.retum.jobisdesignsystemv2.foundation.JobisTheme
3131import team.retum.jobisdesignsystemv2.foundation.JobisTypography
3232import team.retum.jobisdesignsystemv2.text.JobisText
33+ import team.retum.usecase.entity.application.EmploymentStatusEntity
34+
35+ const val MAX_STUDENT = 16
3336
3437@Composable
3538internal fun EmploymentDetail (
@@ -38,7 +41,7 @@ internal fun EmploymentDetail(
3841 employmentDetailViewModel : EmploymentDetailViewModel = hiltViewModel(),
3942) {
4043 val state by employmentDetailViewModel.state.collectAsStateWithLifecycle()
41- val classNameList = listOf (" 소프트웨어 1반" , " 소프트웨어 2반" , " 임베디드 3반" , " 인공지능 4반" )
44+ val classNameList = listOf (" 소프트웨어 개발 1반" , " 소프트웨어 개발 2반" , " 임베디드 개발 3반" , " 인공지능 개발 4반" )
4245
4346 LaunchedEffect (Unit ) {
4447 with (employmentDetailViewModel) {
@@ -52,8 +55,8 @@ internal fun EmploymentDetail(
5255 classId = classId,
5356 passStudent = state.passStudent,
5457 totalStudent = state.totalStudent,
55- companyList = state.companyInfo,
5658 classNameList = classNameList,
59+ classInfoList = state.classInfoList.toMutableList(),
5760 onBackPressed = onBackPressed,
5861 )
5962}
@@ -63,8 +66,8 @@ private fun EmploymentDetailScreen(
6366 classId : Long ,
6467 passStudent : Int ,
6568 totalStudent : Int ,
66- companyList : List <CompanyItem >,
6769 classNameList : List <String >,
70+ classInfoList : MutableList <EmploymentStatusEntity .ClassEmploymentStatusEntity .GetEmploymentRateList >,
6871 onBackPressed : () -> Unit ,
6972) {
7073 Column (
@@ -82,24 +85,22 @@ private fun EmploymentDetailScreen(
8285 verticalArrangement = Arrangement .spacedBy(32 .dp),
8386 contentPadding = PaddingValues (top = 32 .dp, start = 24 .dp, end = 24 .dp, bottom = 24 .dp),
8487 ) {
85- if (companyList.isNotEmpty()) {
86- items(items = companyList) { company ->
87- CompanyCard (
88- imageUrl = company.logoUrl,
89- companyName = company.companyName,
90- )
91- }
92- } else {
93- val list = List (totalStudent) {
94- CompanyItem (
95- companyName = " " ,
96- logoUrl = " " ,
88+ classInfoList.apply {
89+ repeat(MAX_STUDENT - passStudent) {
90+ add(
91+ EmploymentStatusEntity .ClassEmploymentStatusEntity .GetEmploymentRateList (
92+ id = 0 ,
93+ companyName = " " ,
94+ logoUrl = " " ,
95+ ),
9796 )
9897 }
99- items(items = list) { company ->
98+ }
99+ if (classInfoList.isNotEmpty()) {
100+ items(items = classInfoList) { company ->
100101 CompanyCard (
101- imageUrl = company.logoUrl,
102102 companyName = company.companyName,
103+ imageUrl = company.logoUrl,
103104 )
104105 }
105106 }
@@ -133,6 +134,8 @@ private fun CompanyCard(
133134 .background(color = JobisTheme .colors.inverseSurface),
134135 ) {
135136 AsyncImage (
137+ modifier = Modifier
138+ .align(Alignment .Center ),
136139 model = imageUrl,
137140 contentDescription = companyName,
138141 )
0 commit comments