|
1 | 1 | <template> |
2 | 2 | <Card class="w-full py-0"> |
3 | | - <CardHeader class="w-full"> |
4 | | - <Accordion type="single" collapsible class="w-full"> |
5 | | - <AccordionItem value="participations"> |
6 | | - <AccordionTrigger class="text-lg font-semibold px-0 cursor-pointer"> |
7 | | - Participations |
8 | | - </AccordionTrigger> |
9 | | - <AccordionContent class="px-0"> |
10 | | - <div |
11 | | - v-if="sortedParticipations.length === 0" |
12 | | - class="text-muted-foreground p-4" |
13 | | - > |
14 | | - No participations found. |
15 | | - </div> |
16 | | - <div v-else class="space-y-4"> |
17 | | - <!-- Current participation - Editable or Create --> |
18 | | - <div v-if="currentParticipation"> |
19 | | - <div class="flex items-center gap-2 mb-3"> |
20 | | - <h4 class="text-sm font-medium text-muted-foreground"> |
21 | | - Current |
22 | | - </h4> |
23 | | - </div> |
24 | | - <EditableCompanyParticipation |
25 | | - v-if="isCompanyParticipation(currentParticipation)" |
26 | | - :participation="currentParticipation" |
27 | | - :company-id="entityId" |
28 | | - /> |
29 | | - <EditableSpeakerParticipation |
30 | | - v-else-if="isSpeakerParticipation(currentParticipation)" |
31 | | - :participation="currentParticipation" |
32 | | - :speaker-id="entityId" |
33 | | - /> |
34 | | - </div> |
35 | | - |
36 | | - <!-- Create participation if no current participation exists --> |
37 | | - <div v-else-if="getCurrentEvent()"> |
38 | | - <div class="flex items-center gap-2 mb-3"> |
39 | | - <h4 class="text-sm font-medium text-muted-foreground"> |
40 | | - Current |
41 | | - </h4> |
42 | | - </div> |
43 | | - |
44 | | - <EmptyStateCard |
45 | | - title="Create Participation" |
46 | | - :description="`Click to participate in ${getEventName(getCurrentEvent()?.id || 0)}`" |
47 | | - :loading="isCreatingParticipation" |
48 | | - loading-text="Creating..." |
49 | | - @click="createParticipation" |
50 | | - /> |
51 | | - </div> |
52 | | - |
53 | | - <!-- Past participations - Read-only --> |
54 | | - <div v-if="pastParticipations.length > 0"> |
55 | | - <h4 |
56 | | - v-if="currentParticipation || getCurrentEvent()" |
57 | | - class="text-sm font-medium text-muted-foreground mb-3 mt-6" |
58 | | - > |
59 | | - Past Participations |
60 | | - </h4> |
| 3 | + <CardHeader class="w-full pt-6"> |
| 4 | + <h2 class="text-lg font-semibold mb-4">Participations</h2> |
| 5 | + <div v-if="sortedParticipations.length > 0" class="space-y-4"> |
| 6 | + <div v-if="currentParticipation"> |
| 7 | + <div class="flex items-center gap-2 mb-3"> |
| 8 | + <h4 class="text-sm font-medium text-muted-foreground">Current</h4> |
| 9 | + </div> |
| 10 | + <EditableCompanyParticipation |
| 11 | + v-if="isCompanyParticipation(currentParticipation)" |
| 12 | + :participation="currentParticipation" |
| 13 | + :company-id="entityId" |
| 14 | + /> |
| 15 | + <EditableSpeakerParticipation |
| 16 | + v-else-if="isSpeakerParticipation(currentParticipation)" |
| 17 | + :participation="currentParticipation" |
| 18 | + :speaker-id="entityId" |
| 19 | + /> |
| 20 | + </div> |
| 21 | + <div v-else-if="getCurrentEvent()"> |
| 22 | + <div class="flex items-center gap-2 mb-3"> |
| 23 | + <h4 class="text-sm font-medium text-muted-foreground">Current</h4> |
| 24 | + </div> |
| 25 | + <EmptyStateCard |
| 26 | + title="Create Participation" |
| 27 | + :description="`Click to participate in ${getEventName(getCurrentEvent()?.id || 0)}`" |
| 28 | + :loading="isCreatingParticipation" |
| 29 | + loading-text="Creating..." |
| 30 | + @click="createParticipation" |
| 31 | + /> |
| 32 | + </div> |
| 33 | + <div v-if="pastParticipations.length > 0"> |
| 34 | + <Accordion type="single" collapsible class="w-full"> |
| 35 | + <AccordionItem value="pastParticipations"> |
| 36 | + <AccordionTrigger |
| 37 | + class="text-sm font-semibold px-0 cursor-pointer" |
| 38 | + > |
| 39 | + Past Participations |
| 40 | + </AccordionTrigger> |
| 41 | + <AccordionContent class="px-0 pt-4"> |
61 | 42 | <div class="space-y-4"> |
62 | 43 | <Card |
63 | 44 | v-for="participation in pastParticipations" |
|
138 | 119 | </div> |
139 | 120 | </Card> |
140 | 121 | </div> |
141 | | - </div> |
142 | | - </div> |
143 | | - </AccordionContent> |
144 | | - </AccordionItem> |
145 | | - </Accordion> |
| 122 | + </AccordionContent> |
| 123 | + </AccordionItem> |
| 124 | + </Accordion> |
| 125 | + </div> |
| 126 | + </div> |
| 127 | + <div v-else class="text-muted-foreground p-4"> |
| 128 | + No participations found. |
| 129 | + </div> |
146 | 130 | </CardHeader> |
147 | 131 | </Card> |
148 | 132 | </template> |
|
0 commit comments