This commit is contained in:
Face 2025-06-27 21:26:12 +03:00
parent 95d6997774
commit 3e9a22e788
6 changed files with 16 additions and 14 deletions

View file

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui"; import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
let { ref = $bindable(null), ...restProps }: DropdownMenuPrimitive.GroupProps = $props(); let { ref, ...restProps }: DropdownMenuPrimitive.GroupProps = $props();
</script> </script>
<DropdownMenuPrimitive.Group bind:ref data-slot="dropdown-menu-group" {...restProps} /> <DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...restProps} />

View file

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui"; import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
let { ref = $bindable(null), ...restProps }: DropdownMenuPrimitive.TriggerProps = $props(); let { ref, ...restProps }: DropdownMenuPrimitive.TriggerProps = $props();
</script> </script>
<DropdownMenuPrimitive.Trigger bind:ref data-slot="dropdown-menu-trigger" {...restProps} /> <DropdownMenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...restProps} />

View file

@ -6,12 +6,12 @@
ref = $bindable(null), ref = $bindable(null),
class: className, class: className,
...restProps ...restProps
}: WithoutChildren<WithElementRef<HTMLAttributes<HTMLDivElement>>> = $props(); }: WithoutChildren<WithElementRef<HTMLAttributes<HTMLSpanElement>>> = $props();
</script> </script>
<div <span
bind:this={ref} bind:this={ref}
data-slot="skeleton" data-slot="skeleton"
class={cn("bg-accent animate-pulse rounded-md", className)} class={cn("bg-accent animate-pulse rounded-md", className)}
{...restProps} {...restProps}
></div> ></span>

View file

@ -2,11 +2,14 @@ import type { LayoutServerLoad } from './$types';
import { dev } from '$app/environment'; import { dev } from '$app/environment';
export const load: LayoutServerLoad = async (event) => { export const load: LayoutServerLoad = async (event) => {
event.setHeaders({ // Only set Cache-Control if not already set
'Cache-Control': dev if (!event.request.headers.get('cache-control')) {
? 'no-cache' event.setHeaders({
: 'private, max-age=30' 'Cache-Control': dev
}); ? 'no-cache'
: 'private, max-age=30'
});
}
// Use the user data already fetched and processed in hooks // Use the user data already fetched and processed in hooks
return { return {

View file

@ -1 +0,0 @@
export const ssr = false;

View file

@ -16,5 +16,5 @@ export async function GET(event) {
route: { id: "/api/hopium/questions/[id]" } route: { id: "/api/hopium/questions/[id]" }
}; };
return await getHopiumQuestion(hopiumEvent); return await getHopiumQuestion(hopiumEvent as any);
} }