|
|
|
|
@ -155,32 +155,45 @@ export function UrlInput({
|
|
|
|
|
{history.map((entry) => {
|
|
|
|
|
const displayTitle = entry.chapterTitle || (entry.title && entry.title !== entry.url ? entry.title : null);
|
|
|
|
|
return (
|
|
|
|
|
<button
|
|
|
|
|
key={entry.url}
|
|
|
|
|
className="history-item"
|
|
|
|
|
onClick={() => {
|
|
|
|
|
setUrl(entry.url);
|
|
|
|
|
onLoad(entry.url);
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
|
|
|
|
<path d="M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 18a8 8 0 1 1 8-8 8 8 0 0 1-8 8z"/>
|
|
|
|
|
<path d="M12 6v6l4 2"/>
|
|
|
|
|
</svg>
|
|
|
|
|
<div className="history-info">
|
|
|
|
|
{displayTitle ? (
|
|
|
|
|
<>
|
|
|
|
|
<span className="history-manga-title">{displayTitle}</span>
|
|
|
|
|
<span className="history-url-sub">{entry.url}</span>
|
|
|
|
|
</>
|
|
|
|
|
) : (
|
|
|
|
|
<span className="history-url">{entry.url}</span>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
<span className="history-time">
|
|
|
|
|
{new Date(entry.timestamp).toLocaleDateString('ko-KR')}
|
|
|
|
|
</span>
|
|
|
|
|
</button>
|
|
|
|
|
<div key={entry.url} className="history-item-wrapper">
|
|
|
|
|
<button
|
|
|
|
|
className="history-item"
|
|
|
|
|
onClick={() => {
|
|
|
|
|
setUrl(entry.url);
|
|
|
|
|
onLoad(entry.url);
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
|
|
|
|
<path d="M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 18a8 8 0 1 1 8-8 8 8 0 0 1-8 8z"/>
|
|
|
|
|
<path d="M12 6v6l4 2"/>
|
|
|
|
|
</svg>
|
|
|
|
|
<div className="history-info">
|
|
|
|
|
{displayTitle ? (
|
|
|
|
|
<>
|
|
|
|
|
<span className="history-manga-title">{displayTitle}</span>
|
|
|
|
|
<span className="history-url-sub">{entry.url}</span>
|
|
|
|
|
</>
|
|
|
|
|
) : (
|
|
|
|
|
<span className="history-url">{entry.url}</span>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
<span className="history-time">
|
|
|
|
|
{new Date(entry.timestamp).toLocaleDateString('ko-KR')}
|
|
|
|
|
</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
className="history-delete-btn"
|
|
|
|
|
title="이 항목 삭제"
|
|
|
|
|
onClick={(e) => {
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
const updated = history.filter((h) => h.url !== entry.url);
|
|
|
|
|
localStorage.setItem(HISTORY_KEY, JSON.stringify(updated));
|
|
|
|
|
setHistory(updated);
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
✕
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
</div>
|
|
|
|
|
|