- git 이력에서 publish 파일 45개 복원 (layouts, pages, components, scss) - Sidebar.jsx: import.meta.glob 패턴으로 publish 폴더 없이도 빌드 가능 - App.jsx: lazy import에 catch 추가로 publish 누락 시 안내 메시지 표시 - .gitignore: src/publish/ 제외 해제 (git 추적 포함) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
25 lines
590 B
JavaScript
25 lines
590 B
JavaScript
import { useState } from "react";
|
|
|
|
function Slider({ label = "", min = 0, max = 100, defaultValue = 50 }) {
|
|
const [value, setValue] = useState(defaultValue);
|
|
|
|
const percent = ((value - min) / (max - min)) * 100;
|
|
|
|
return (
|
|
<label className="rangeWrap">
|
|
<span className="rangeLabel">{label}</span>
|
|
<input
|
|
type="range"
|
|
min={min}
|
|
max={max}
|
|
value={value}
|
|
onChange={(e) => setValue(Number(e.target.value))}
|
|
style={{ "--percent": `${percent}%` }}
|
|
aria-label={label}
|
|
/>
|
|
</label>
|
|
);
|
|
}
|
|
|
|
export default Slider;
|