package com.zaojiao.component.common

import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.size
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Paint
import androidx.compose.ui.graphics.PaintingStyle
import androidx.compose.ui.graphics.Path
import androidx.compose.ui.graphics.StrokeCap
import androidx.compose.ui.graphics.drawscope.drawIntoCanvas
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp

object Icons {

    @Composable
    fun Forward(
        size: Size,
        color: Color,
        width: Dp,
    ) {
        Canvas(
            modifier = Modifier.size(size.width.dp, size.height.dp),
        ) {
            drawIntoCanvas { canvas ->
                val paint = Paint()
                paint.color = color
                paint.strokeWidth = width.toPx()
                paint.style = PaintingStyle.Stroke
                paint.strokeCap = StrokeCap.Round

                val path = Path()
                path.moveTo(0f, 0f)
                path.lineTo(this.size.width, this.size.height / 2)
                path.lineTo(0f, this.size.height)

                canvas.drawPath(path, paint)
            }
        }
    }
}
