fix: refactored the codebase

This commit is contained in:
2026-08-20 23:00:47 +02:00
parent 6f47ed0674
commit a77f74911d
64 changed files with 2864 additions and 1739 deletions
+28
View File
@@ -0,0 +1,28 @@
export type DashboardRoom = {
id: string;
title: string | null;
join_code: string;
current_round: number;
players_count: number;
active_player_count: number;
last_activity_at: string | null;
closed_at: string | null;
};
export type DashboardPageProps = {
rooms: DashboardRoom[];
favoriteRooms: DashboardRoom[];
};
export type DashboardRoomCardProps = {
room: DashboardRoom;
showActions?: boolean;
};
export type OwnedRoomListProps = {
rooms: DashboardRoom[];
};
export type FavoriteRoomListProps = {
favoriteRooms: DashboardRoom[];
};
+2 -4
View File
@@ -1,4 +1,5 @@
import type { Auth } from '@/types/auth';
import type { RoomNotice } from '@/types/room';
// Extend ImportMeta interface for Vite...
declare module 'vite/client' {
@@ -18,10 +19,7 @@ declare module '@inertiajs/core' {
sharedPageProps: {
name: string;
auth: Auth;
roomNotice: {
guest_retention_days: number;
account_retention_days: number;
} | null;
roomNotice: RoomNotice | null;
sidebarOpen: boolean;
[key: string]: unknown;
};
+2
View File
@@ -1,4 +1,6 @@
export * from './auth';
export * from './dashboard';
export * from './navigation';
export * from './room';
export * from './settings';
export * from './ui';
+111 -5
View File
@@ -5,14 +5,125 @@ export type PokerCard = {
label: string;
};
export type RoomDeck = {
name: string;
cards: PokerCard[];
};
export type SelectableDeck = RoomDeck & {
id: number;
};
export type RoomStatistics = {
average: string | null;
median: string | null;
};
export type RoomPlayer = {
id: number;
name: string;
is_moderator: boolean;
is_owner: boolean;
has_voted: boolean;
vote: string | null;
};
export type CurrentRoomPlayer = {
id: number;
name: string;
is_moderator: boolean;
current_vote: string | null;
};
export type PokerRoom = {
id: string;
title: string | null;
join_code: string;
owner_id: number | null;
is_favorite: boolean;
current_round: number;
revealed: boolean;
state_version: number;
statistics: RoomStatistics | null;
deck: RoomDeck;
players: RoomPlayer[];
};
export type ClosedRoom = {
title: string | null;
join_code: string;
};
export type RoomNotice = {
guest_retention_days: number;
account_retention_days: number;
};
export type RoomPageProps = {
room: PokerRoom;
currentPlayer: CurrentRoomPlayer;
};
export type CreateRoomPageProps = {
decks: SelectableDeck[];
defaultPlayerName: string | null;
};
export type JoinRoomPageProps = {
join_code?: string;
defaultPlayerName: string | null;
closedRoom: ClosedRoom | null;
};
export type SeatStyle = CSSProperties & {
'--card-x': string;
'--card-y': string;
};
export type PositionedRoomPlayer = RoomPlayer & {
isTopSeat: boolean;
seatStyle: SeatStyle;
};
export type RoomRetentionNoticeProps = {
notice: RoomNotice;
};
export type RoomHeaderProps = Pick<
PokerRoom,
'id' | 'title' | 'join_code' | 'is_favorite'
> & {
canFavorite: boolean;
};
export type RoomTableProps = {
room: PokerRoom;
currentPlayer: CurrentRoomPlayer;
};
export type RoomSeatProps = {
player: PositionedRoomPlayer;
currentPlayerId: number;
currentVote: string | null;
cards: PokerCard[];
revealed: boolean;
isPaperBallHit: boolean;
throwDisabled: boolean;
};
export type RoomModeratorControlsProps = {
roomId: string;
revealed: boolean;
hasVotes: boolean;
};
export type RoomVoteDeckProps = {
roomId: string;
revealed: boolean;
cards: PokerCard[];
currentVote: string | null;
};
export type RoomStateChange =
| 'player_joined'
| 'vote_changed'
@@ -27,8 +138,3 @@ export type RoomStateChangedPayload = {
version: number;
change: RoomStateChange;
};
export type SeatStyle = CSSProperties & {
'--card-x': string;
'--card-y': string;
};
+10
View File
@@ -0,0 +1,10 @@
import type { Passkey } from '@/types/auth';
export type SecurityPageProps = {
canManageTwoFactor?: boolean;
requiresConfirmation?: boolean;
twoFactorEnabled?: boolean;
canManagePasskeys?: boolean;
passkeys?: Passkey[];
passwordRules: string;
};