feat: fetch and pass previous weather entries through component tree
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -28,6 +28,13 @@ interface Share {
|
||||
};
|
||||
}
|
||||
|
||||
type PreviousEntry = {
|
||||
performanceEmoji: string | null;
|
||||
moralEmoji: string | null;
|
||||
fluxEmoji: string | null;
|
||||
valueCreationEmoji: string | null;
|
||||
};
|
||||
|
||||
interface WeatherBoardProps {
|
||||
sessionId: string;
|
||||
currentUserId: string;
|
||||
@@ -44,6 +51,7 @@ interface WeatherBoardProps {
|
||||
email: string;
|
||||
};
|
||||
canEdit: boolean;
|
||||
previousEntries: Map<string, PreviousEntry>;
|
||||
}
|
||||
|
||||
export function WeatherBoard({
|
||||
@@ -53,6 +61,7 @@ export function WeatherBoard({
|
||||
shares,
|
||||
owner,
|
||||
canEdit,
|
||||
previousEntries,
|
||||
}: WeatherBoardProps) {
|
||||
// Get all users who have access: owner + shared users
|
||||
const allUsers = useMemo(() => {
|
||||
@@ -137,6 +146,7 @@ export function WeatherBoard({
|
||||
currentUserId={currentUserId}
|
||||
entry={entry}
|
||||
canEdit={canEdit}
|
||||
previousEntry={previousEntries.get(entry.userId) ?? null}
|
||||
/>
|
||||
))}
|
||||
</tbody>
|
||||
|
||||
@@ -22,14 +22,22 @@ interface WeatherEntry {
|
||||
};
|
||||
}
|
||||
|
||||
type PreviousEntry = {
|
||||
performanceEmoji: string | null;
|
||||
moralEmoji: string | null;
|
||||
fluxEmoji: string | null;
|
||||
valueCreationEmoji: string | null;
|
||||
};
|
||||
|
||||
interface WeatherCardProps {
|
||||
sessionId: string;
|
||||
currentUserId: string;
|
||||
entry: WeatherEntry;
|
||||
canEdit: boolean;
|
||||
previousEntry?: PreviousEntry | null;
|
||||
}
|
||||
|
||||
export function WeatherCard({ sessionId, currentUserId, entry, canEdit }: WeatherCardProps) {
|
||||
export function WeatherCard({ sessionId, currentUserId, entry, canEdit, previousEntry }: WeatherCardProps) {
|
||||
const [isPending, startTransition] = useTransition();
|
||||
const [notes, setNotes] = useState(entry.notes || '');
|
||||
const [performanceEmoji, setPerformanceEmoji] = useState(entry.performanceEmoji || null);
|
||||
@@ -104,6 +112,9 @@ export function WeatherCard({ sessionId, currentUserId, entry, canEdit }: Weathe
|
||||
// For now, we'll use a placeholder - in real app, you'd pass user info as prop
|
||||
const user = entry.user;
|
||||
|
||||
// previousEntry is available for future use in Task 6
|
||||
void previousEntry;
|
||||
|
||||
return (
|
||||
<tr className={`border-b border-border ${isPending ? 'opacity-50' : ''}`}>
|
||||
{/* User column */}
|
||||
|
||||
Reference in New Issue
Block a user