refactor(planner): import shared types in EmptyDayTile instead of re-declaring
Removes local TagItem, SuggestionRecipe, TopSuggestion, Slot interfaces and imports Suggestion, SlotMap from types.ts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,32 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { computeReasoningTags } from './reasoningTags';
|
import { computeReasoningTags } from './reasoningTags';
|
||||||
import { formatDayAbbr } from '$lib/planner/week';
|
import { formatDayAbbr } from '$lib/planner/week';
|
||||||
|
import type { Suggestion, SlotMap } from '$lib/planner/types';
|
||||||
interface TagItem {
|
|
||||||
id?: string;
|
|
||||||
name?: string;
|
|
||||||
tagType?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface SuggestionRecipe {
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
cookTimeMin?: number;
|
|
||||||
effort?: string;
|
|
||||||
tags?: TagItem[];
|
|
||||||
}
|
|
||||||
|
|
||||||
interface TopSuggestion {
|
|
||||||
recipe: SuggestionRecipe;
|
|
||||||
scoreDelta: number;
|
|
||||||
hasConflict: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Slot {
|
|
||||||
id?: string;
|
|
||||||
slotDate?: string;
|
|
||||||
recipe?: any | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
let {
|
let {
|
||||||
slotDate,
|
slotDate,
|
||||||
@@ -39,8 +14,8 @@
|
|||||||
slotDate: string;
|
slotDate: string;
|
||||||
slotId: string;
|
slotId: string;
|
||||||
isPlanner: boolean;
|
isPlanner: boolean;
|
||||||
slotMap: Record<string, Slot>;
|
slotMap: SlotMap;
|
||||||
topSuggestion?: TopSuggestion;
|
topSuggestion?: Suggestion;
|
||||||
onaddrecipe?: () => void;
|
onaddrecipe?: () => void;
|
||||||
} = $props();
|
} = $props();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user