fix
This commit is contained in:
@@ -6,7 +6,6 @@ interface SidebarProps {
|
|||||||
selectedId: string | null;
|
selectedId: string | null;
|
||||||
onSelect: (id: string) => void;
|
onSelect: (id: string) => void;
|
||||||
onNewClick: () => void;
|
onNewClick: () => void;
|
||||||
onDelete?: (id: string) => void;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function statusIcon(status: RecommendationSummary['status']): string {
|
function statusIcon(status: RecommendationSummary['status']): string {
|
||||||
@@ -27,7 +26,7 @@ function statusClass(status: RecommendationSummary['status']): string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Sidebar({ list, selectedId, onSelect, onNewClick, onDelete }: SidebarProps) {
|
export function Sidebar({ list, selectedId, onSelect, onNewClick }: SidebarProps) {
|
||||||
return (
|
return (
|
||||||
<aside class="sidebar">
|
<aside class="sidebar">
|
||||||
<div class="sidebar-header">
|
<div class="sidebar-header">
|
||||||
@@ -57,13 +56,6 @@ export function Sidebar({ list, selectedId, onSelect, onNewClick, onDelete }: Si
|
|||||||
<span class={`sidebar-type-badge sidebar-type-${item.media_type}`}>
|
<span class={`sidebar-type-badge sidebar-type-${item.media_type}`}>
|
||||||
{item.media_type === 'movie' ? 'Film' : 'TV'}
|
{item.media_type === 'movie' ? 'Film' : 'TV'}
|
||||||
</span>
|
</span>
|
||||||
{onDelete && (
|
|
||||||
<button
|
|
||||||
class="sidebar-item-delete"
|
|
||||||
onClick={(e) => { e.stopPropagation(); onDelete(item.id); }}
|
|
||||||
title="Delete"
|
|
||||||
>×</button>
|
|
||||||
)}
|
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -114,11 +114,6 @@ export function Recom({ id }: RecomProps) {
|
|||||||
setRec((prev) => (prev ? { ...prev, status: 'pending' as const } : null));
|
setRec((prev) => (prev ? { ...prev, status: 'pending' as const } : null));
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleDelete = async (sid: string) => {
|
|
||||||
await deleteRec(sid);
|
|
||||||
if (sid === id) route('/');
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleCreateNew = async (body: {
|
const handleCreateNew = async (body: {
|
||||||
main_prompt: string;
|
main_prompt: string;
|
||||||
liked_shows: string;
|
liked_shows: string;
|
||||||
@@ -142,7 +137,6 @@ export function Recom({ id }: RecomProps) {
|
|||||||
selectedId={id}
|
selectedId={id}
|
||||||
onSelect={(sid) => route(`/recom/${sid}`)}
|
onSelect={(sid) => route(`/recom/${sid}`)}
|
||||||
onNewClick={() => setShowModal(true)}
|
onNewClick={() => setShowModal(true)}
|
||||||
onDelete={handleDelete}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<main class="main-content">
|
<main class="main-content">
|
||||||
|
|||||||
Reference in New Issue
Block a user