2025-04-01 16:15:20 +02:00
|
|
|
import React from 'react'
|
|
|
|
import { controlDesc } from '@freesewing/config'
|
|
|
|
import { BulletIcon } from '@freesewing/react/components/Icon'
|
|
|
|
|
2025-05-10 13:44:03 +02:00
|
|
|
/**
|
|
|
|
* A component to render a visualisation of the user's control/UX setting
|
|
|
|
*
|
|
|
|
* @component
|
|
|
|
* @param {object} props - All component props
|
|
|
|
* @param {number} props.control - The user's control setting (a number)
|
|
|
|
* @returns {JSX.Element}
|
|
|
|
*/
|
|
|
|
export const ControlScore = ({ control }) =>
|
2025-04-01 16:15:20 +02:00
|
|
|
control ? (
|
2025-05-10 13:44:03 +02:00
|
|
|
<div className={`tw:flex tw:flex-row tw:items-center tw:text-base-content`}>
|
2025-04-01 16:15:20 +02:00
|
|
|
{Object.keys(controlDesc).map((score) => (
|
|
|
|
<BulletIcon
|
|
|
|
fill={control >= score ? true : false}
|
2025-04-18 08:07:13 +00:00
|
|
|
className="tw:w-6 tw:h-6 tw:-ml-1"
|
2025-04-01 16:15:20 +02:00
|
|
|
key={score}
|
|
|
|
/>
|
|
|
|
))}
|
|
|
|
</div>
|
|
|
|
) : null
|