11import type { Meta , StoryObj } from "@storybook/vue3-vite" ;
22import { useCookies } from "@vueuse/integrations/useCookies" ;
33import GameScores from "~/components/GameScores.vue" ;
4+ import type { player } from "~duckguessr-prisma-client" ;
45
56const meta : Meta < typeof GameScores > = {
67 title : "GameScores" ,
@@ -9,95 +10,131 @@ const meta: Meta<typeof GameScores> = {
910 layout : "centered" ,
1011 } ,
1112 tags : [ "autodocs" ] ,
12- argTypes : {
13- gameId : {
14- control : "number" ,
15- } ,
16- } ,
13+ argTypes : { } ,
1714} ;
1815
1916export default meta ;
2017type Story = StoryObj < typeof meta > ;
2118
19+ const players : player [ ] = [
20+ {
21+ id : 1 ,
22+ username : "player 1" ,
23+ ducksmanagerId : 1 ,
24+ avatar : "https://example.com/avatar.png" ,
25+ } ,
26+ {
27+ id : 2 ,
28+ username : "player 2" ,
29+ ducksmanagerId : 2 ,
30+ avatar : "https://example.com/avatar.png" ,
31+ } ,
32+ ] ;
33+
2234export const Default : Story = {
2335 args : {
24- gameId : 100 ,
25- players : [
26- {
27- player_id : 1 ,
28- player : {
36+ game : {
37+ datasetId : 1 ,
38+ dataset : {
39+ id : 1 ,
40+ name : "dataset" ,
41+ title : "dataset" ,
42+ description : "dataset" ,
43+ active : true ,
44+ } ,
45+ rounds : [
46+ {
2947 id : 1 ,
30- username : "player 1" ,
48+ startedAt : new Date ( ) ,
49+ finishedAt : new Date ( ) ,
50+ gameId : 100 ,
51+ roundNumber : 1 ,
52+ sitecodeUrl : "thumbnails3/webusers/2014/04/hu_mm1992_07e_001.jpg" ,
53+ roundScores : [
54+ {
55+ id : 1 ,
56+ roundId : 1 ,
57+ playerId : 1 ,
58+ scoreTypeName : "Correct author" ,
59+ score : 10 ,
60+ timeSpentGuessing : 10 ,
61+ speedBonus : 10 ,
62+ } ,
63+ ] ,
3164 } ,
32- } ,
33- {
34- player_id : 2 ,
35- player : {
65+ {
3666 id : 2 ,
37- username : "player 2" ,
67+ startedAt : new Date ( ) ,
68+ finishedAt : new Date ( ) ,
69+ gameId : 100 ,
70+ roundNumber : 2 ,
71+ sitecodeUrl : "thumbnails3/webusers/2017/03/it_om_1341g_001.jpg" ,
72+ roundScores : [
73+ {
74+ id : 1 ,
75+ roundId : 2 ,
76+ playerId : 1 ,
77+ scoreTypeName : "Correct author" ,
78+ score : 10 ,
79+ timeSpentGuessing : 10 ,
80+ speedBonus : 10 ,
81+ } ,
82+ {
83+ id : 2 ,
84+ roundId : 2 ,
85+ playerId : 2 ,
86+ scoreTypeName : "Correct author" ,
87+ score : 10 ,
88+ timeSpentGuessing : 10 ,
89+ speedBonus : 10 ,
90+ } ,
91+ ] ,
3892 } ,
39- } ,
40- ] ,
41- authors : [
42- {
43- personcode : "DR" ,
44- personnationality : "us" ,
45- personfullname : "Don Rosa" ,
46- } ,
47- {
48- personcode : "CB" ,
49- personnationality : "us" ,
50- personfullname : "Carl Barks" ,
51- } ,
52- {
53- personcode : "RSc" ,
54- personnationality : "it" ,
55- personfullname : "Romano Scarpa" ,
56- } ,
57- ] ,
58- rounds : [
59- {
60- personcode : "DR" ,
61- round_number : 1 ,
62- sitecode_url : "thumbnails3/webusers/2014/04/hu_mm1992_07e_001.jpg" ,
63- round_scores : [
64- {
65- player_id : 1 ,
66- score_type_name : "Correct author" ,
67- score : 10 ,
68- } ,
69- ] ,
70- } ,
71- {
72- personcode : "CB" ,
73- round_number : 2 ,
74- sitecode_url : "thumbnails3/webusers/2017/03/it_om_1341g_001.jpg" ,
75- round_scores : [
76- {
77- player_id : 1 ,
78- score_type_name : "Correct author" ,
79- score : 10 ,
80- } ,
81- {
82- player_id : 2 ,
83- score_type_name : "Correct author" ,
84- score : 10 ,
85- } ,
86- ] ,
87- } ,
88- {
89- personcode : "RSc" ,
90- round_number : 3 ,
91- sitecode_url : "webusers/webusers-auth/rsc_ommi0o.png" ,
92- round_scores : [ ] ,
93- } ,
94- ] ,
93+ {
94+ id : 3 ,
95+ startedAt : new Date ( ) ,
96+ finishedAt : new Date ( ) ,
97+ gameId : 100 ,
98+ roundNumber : 3 ,
99+ sitecodeUrl : "webusers/webusers-auth/rsc_ommi0o.png" ,
100+ roundScores : [ ] ,
101+ } ,
102+ ] ,
103+ createdAt : new Date ( ) ,
104+ startedAt : new Date ( ) ,
105+ finishedAt : new Date ( ) ,
106+ id : 100 ,
107+ gamePlayers : [
108+ {
109+ id : 1 ,
110+ gameId : 100 ,
111+ playerId : 1 ,
112+ player : players [ 0 ] ,
113+ } ,
114+ {
115+ id : 2 ,
116+ gameId : 100 ,
117+ playerId : 2 ,
118+ player : players [ 1 ] ,
119+ } ,
120+ ] ,
121+ authors : [
122+ {
123+ personcode : "DR" ,
124+ nationalitycountrycode : "us" ,
125+ fullname : "Don Rosa" ,
126+ } ,
127+ {
128+ personcode : "CB" ,
129+ nationalitycountrycode : "us" ,
130+ fullname : "Carl Barks" ,
131+ } ,
132+ {
133+ personcode : "RSc" ,
134+ nationalitycountrycode : "it" ,
135+ fullname : "Romano Scarpa" ,
136+ } ,
137+ ] ,
138+ } ,
95139 } ,
96- decorators : [
97- ( ) => ( {
98- setup ( ) {
99- useCookies ( ) . set ( "duckguessr-id" , 1 ) ;
100- } ,
101- } ) ,
102- ] ,
103140} ;
0 commit comments