import { useParty } from "#/hooks/use-party";
import { Question } from "./question";
import { QuestionReview } from "./question-review";
import { Results } from "./results";
import { SpotifyPlayback } from "./spotify-playback";

export function PartyView() {
	const { party } = useParty();
	if (!party?.data) return null;

	switch (party.data.status) {
		case "running":
			return (
				<div className="space-y-4">
					<SpotifyPlayback />
					<Question />
				</div>
			);
		case "review":
			return (
				<div className="space-y-4">
					<SpotifyPlayback />
					<QuestionReview />
				</div>
			);
		case "results":
			return <Results />;
	}
}
