|
3 | 3 | import { PUBLIC_SUPABASE_URL } from "$env/static/public" |
4 | 4 | import type { Script } from "$lib/types/collection" |
5 | 5 | import { cropString, encodeSEO, scriptCategories, scriptStatus, scriptTypes } from "$lib/utils" |
6 | | - import { Tooltip } from "@skeletonlabs/skeleton-svelte" |
| 6 | + import { Portal, Tooltip } from "@skeletonlabs/skeleton-svelte" |
7 | 7 |
|
8 | 8 | let { script, customCover, link }: { script: Script; customCover?: string; link?: string } = $props() |
9 | 9 |
|
|
54 | 54 | <footer class="m-2 flex cursor-default justify-between"> |
55 | 55 | <div class="flex"> |
56 | 56 | <Tooltip |
57 | | - open={status} |
58 | | - onOpenChange={(e) => (status = e.open)} |
59 | 57 | positioning={{ placement: "top" }} |
60 | | - triggerBase="cursor-default" |
61 | | - contentBase="card preset-filled p-4" |
62 | 58 | openDelay={200} |
| 59 | + open={status} |
| 60 | + onOpenChange={(e) => (status = e.open)} |
63 | 61 | > |
64 | | - {#snippet trigger()}{scriptStatus[script.metadata.status].icon}{/snippet} |
65 | | - {#snippet content()}{scriptStatus[script.metadata.status].name}{/snippet} |
| 62 | + <Tooltip.Trigger class="cursor-default"> |
| 63 | + {scriptStatus[script.metadata.status].icon} |
| 64 | + </Tooltip.Trigger> |
| 65 | + <Portal> |
| 66 | + <Tooltip.Positioner> |
| 67 | + <Tooltip.Content class="card preset-filled p-4"> |
| 68 | + {scriptStatus[script.metadata.status].name} |
| 69 | + </Tooltip.Content> |
| 70 | + </Tooltip.Positioner> |
| 71 | + </Portal> |
66 | 72 | </Tooltip> |
| 73 | + |
67 | 74 | <Tooltip |
68 | | - open={type} |
69 | | - onOpenChange={(e) => (type = e.open)} |
70 | 75 | positioning={{ placement: "top" }} |
71 | | - triggerBase="cursor-default" |
72 | | - contentBase="card preset-filled p-4" |
73 | 76 | openDelay={200} |
| 77 | + open={type} |
| 78 | + onOpenChange={(e) => (type = e.open)} |
74 | 79 | > |
75 | | - {#snippet trigger()}{scriptTypes[script.metadata.type].icon}{/snippet} |
76 | | - {#snippet content()}{scriptTypes[script.metadata.type].name}{/snippet} |
| 80 | + <Tooltip.Trigger class="cursor-default"> |
| 81 | + {scriptTypes[script.metadata.type].icon} |
| 82 | + </Tooltip.Trigger> |
| 83 | + <Portal> |
| 84 | + <Tooltip.Positioner> |
| 85 | + <Tooltip.Content class="card preset-filled p-4"> |
| 86 | + {scriptTypes[script.metadata.type].name} |
| 87 | + </Tooltip.Content> |
| 88 | + </Tooltip.Positioner> |
| 89 | + </Portal> |
77 | 90 | </Tooltip> |
78 | 91 | </div> |
79 | 92 | <div class="flex"> |
80 | 93 | {#each script.metadata.categories as category, i (i)} |
81 | 94 | <Tooltip |
82 | | - open={categoriesTooltip[i]} |
83 | | - onOpenChange={(e) => (categoriesTooltip[i] = e.open)} |
84 | 95 | positioning={{ placement: "top" }} |
85 | | - triggerBase="cursor-default" |
86 | | - contentBase="card preset-filled p-4" |
87 | 96 | openDelay={200} |
| 97 | + open={categoriesTooltip[i]} |
| 98 | + onOpenChange={(e) => (categoriesTooltip[i] = e.open)} |
88 | 99 | > |
89 | | - {#snippet trigger()}{scriptCategories[category].icon}{/snippet} |
90 | | - {#snippet content()}{scriptCategories[category].name}{/snippet} |
| 100 | + <Tooltip.Trigger class="cursor-default"> |
| 101 | + {scriptCategories[category].icon} |
| 102 | + </Tooltip.Trigger> |
| 103 | + <Portal> |
| 104 | + <Tooltip.Positioner> |
| 105 | + <Tooltip.Content class="card preset-filled p-4"> |
| 106 | + {scriptCategories[category].name} |
| 107 | + </Tooltip.Content> |
| 108 | + </Tooltip.Positioner> |
| 109 | + </Portal> |
91 | 110 | </Tooltip> |
92 | 111 | {/each} |
93 | 112 | </div> |
|
0 commit comments