* feat: adding create bot functionality Signed-off-by: James <james@jan.ai> * update the temperature progress bar Signed-off-by: James <james@jan.ai> * chore: remove tgz Signed-off-by: James <james@jan.ai> * update core dependency Signed-off-by: James <james@jan.ai> * fix e2e test Signed-off-by: James <james@jan.ai> --------- Signed-off-by: James <james@jan.ai> Co-authored-by: James <james@jan.ai>
43 lines
856 B
TypeScript
43 lines
856 B
TypeScript
import { formatTwoDigits } from '@/_utils/converter'
|
|
import React from 'react'
|
|
|
|
type Props = {
|
|
title: string
|
|
value: number
|
|
min: number
|
|
max: number
|
|
step: number
|
|
onValueChanged: (value: number) => void
|
|
}
|
|
|
|
const ProgressSetting: React.FC<Props> = ({
|
|
title,
|
|
value,
|
|
min,
|
|
max,
|
|
step,
|
|
onValueChanged,
|
|
}) => (
|
|
<div className="flex w-full flex-col">
|
|
<p>{title}</p>
|
|
<div className="mt-2 flex items-center gap-2">
|
|
<input
|
|
className="flex-1"
|
|
type="range"
|
|
value={value}
|
|
min={min}
|
|
max={max}
|
|
step={step}
|
|
onChange={(e) => {
|
|
onValueChanged(Number(e.target.value))
|
|
}}
|
|
/>
|
|
<span className="rounded-md border border-[#737d7d] px-2 py-1 text-gray-900">
|
|
{formatTwoDigits(value)}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
)
|
|
|
|
export default ProgressSetting
|