전략편집기 병합
This commit is contained in:
@@ -1269,47 +1269,98 @@ export const StrategyPage: React.FC<Props> = ({ activeIndicators = [] }) => {
|
||||
<div className="sp-panel-body">
|
||||
{/* 전략 목록 */}
|
||||
{rightTab === 'list' && (
|
||||
<div>
|
||||
{isLoading ? (
|
||||
<div className="sp-loading">로딩 중...</div>
|
||||
) : strategies.length === 0 ? (
|
||||
<div className="sp-empty-info">저장된 전략이 없습니다</div>
|
||||
) : (
|
||||
<>
|
||||
<div className="sp-list-header">
|
||||
<span>전략: {strategies.length}개</span>
|
||||
<select className="sp-sort-sel" value={sortOrder}
|
||||
onChange={e => setSortOrder(e.target.value as any)}>
|
||||
<option value="name-asc">이름(A)</option>
|
||||
<option value="name-desc">이름(D)</option>
|
||||
<option value="date-asc">날짜(A)</option>
|
||||
<option value="date-desc">날짜(D)</option>
|
||||
</select>
|
||||
</div>
|
||||
{sortedStrategies.map(s => (
|
||||
<div key={s.id}
|
||||
className={`sp-list-item ${selectedId === s.id ? 'sp-list-item--sel' : ''}`}
|
||||
onClick={() => handleSelectStrategy(s)}>
|
||||
<div className="sp-li-row1">
|
||||
<span className="sp-li-name">{s.name}</span>
|
||||
<span className={`sp-li-chip sp-li-chip--type`}>드래그방식</span>
|
||||
<span className={`sp-li-chip ${s.enabled ? 'sp-li-chip--on' : 'sp-li-chip--off'}`}>
|
||||
{s.enabled ? '활성' : '비활성'}
|
||||
</span>
|
||||
<div className="sp-strat-panel">
|
||||
<div className="sp-strat-panel-head">
|
||||
<h2 className="sp-strat-panel-title">전략 목록</h2>
|
||||
{strategies.length > 0 && (
|
||||
<select
|
||||
className="sp-strat-sort"
|
||||
value={sortOrder}
|
||||
onChange={e => setSortOrder(e.target.value as typeof sortOrder)}
|
||||
aria-label="전략 정렬"
|
||||
>
|
||||
<option value="name-asc">이름(A)</option>
|
||||
<option value="name-desc">이름(D)</option>
|
||||
<option value="date-asc">날짜(A)</option>
|
||||
<option value="date-desc">날짜(D)</option>
|
||||
</select>
|
||||
)}
|
||||
</div>
|
||||
<button type="button" className="sp-new-strat-btn" onClick={handleNew}>
|
||||
+ 새 전략 만들기
|
||||
</button>
|
||||
<div className="sp-strat-list">
|
||||
{isLoading ? (
|
||||
<p className="sp-strat-empty">로딩 중...</p>
|
||||
) : strategies.length === 0 ? (
|
||||
<p className="sp-strat-empty">저장된 전략이 없습니다</p>
|
||||
) : (
|
||||
sortedStrategies.map(s => {
|
||||
const isSel = selectedId === s.id;
|
||||
return (
|
||||
<div
|
||||
key={s.id}
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
className={`sp-strat-item${isSel ? ' sp-strat-item--sel' : ''}`}
|
||||
onClick={() => handleSelectStrategy(s)}
|
||||
onKeyDown={e => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
e.preventDefault();
|
||||
handleSelectStrategy(s);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<span className="sp-strat-name" title={s.name}>{s.name}</span>
|
||||
<div className="sp-strat-item-actions">
|
||||
<button
|
||||
type="button"
|
||||
className="sp-strat-action"
|
||||
title={s.enabled ? '알림 해제' : '알림 추가'}
|
||||
onClick={e => {
|
||||
e.stopPropagation();
|
||||
handleToggleEnabled(s.id);
|
||||
}}
|
||||
>
|
||||
{s.enabled ? '🔔' : '🔕'}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="sp-strat-action"
|
||||
title="복제"
|
||||
onClick={e => {
|
||||
e.stopPropagation();
|
||||
handleDuplicate(s);
|
||||
}}
|
||||
>
|
||||
⎘
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="sp-strat-del"
|
||||
title="전략 삭제"
|
||||
onClick={e => {
|
||||
e.stopPropagation();
|
||||
setDeleteId(s.id);
|
||||
setDeleteOpen(true);
|
||||
}}
|
||||
>
|
||||
<svg viewBox="0 0 16 16" width="14" height="14" aria-hidden>
|
||||
<path
|
||||
fill="currentColor"
|
||||
d="M5.5 2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v.5H12a.5.5 0 0 1 0 1h-.55l-.62 8.07A1.5 1.5 0 0 1 9.83 13H6.17a1.5 1.5 0 0 1-1.49-1.43L4.05 3.5H4a.5.5 0 0 1 0-1h1.5V2zm1.5 0v.5h2V2H7zm-2.38 1.5l.58 7.53a.5.5 0 0 0 .5.47h3.66a.5.5 0 0 0 .5-.47l.58-7.53H4.62z"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
<span className={`sp-strat-status${s.enabled ? ' sp-strat-status--on' : ''}`}>
|
||||
{s.enabled ? '활성' : '비활성'}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="sp-li-actions" onClick={e => e.stopPropagation()}>
|
||||
<button className="sp-li-btn" title={s.enabled ? '알림 해제' : '알림 추가'}
|
||||
onClick={() => handleToggleEnabled(s.id)}>
|
||||
{s.enabled ? '🔔' : '🔕'}
|
||||
</button>
|
||||
<button className="sp-li-btn" title="복제" onClick={() => handleDuplicate(s)}>⎘</button>
|
||||
<button className="sp-li-btn sp-li-btn--del" title="삭제"
|
||||
onClick={() => { setDeleteId(s.id); setDeleteOpen(true); }}>🗑</button>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</>
|
||||
)}
|
||||
);
|
||||
})
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user