feat: google maps

This commit is contained in:
2025-06-10 19:00:22 +01:00
parent e68cc4e0ea
commit bd7f9bc991
10 changed files with 123 additions and 14 deletions

View File

@@ -1,15 +1,16 @@
<script lang="ts">
interface Props {
inputElem?: HTMLInputElement;
name: string;
value?: string | null;
placeholder?: string;
required?: boolean;
}
let { value = $bindable(), name, ...rest }: Props = $props();
let { inputElem = $bindable(), value = $bindable(), name, ...rest }: Props = $props();
</script>
<input type="text" id={name} {name} bind:value {...rest} />
<input type="text" id={name} {name} bind:value bind:this={inputElem} {...rest} />
<style>
input {

View File

@@ -100,7 +100,8 @@ export type Database = {
}
study_spaces: {
Row: {
building_location: string | null
building_location: Json | null
building_location_old: string | null
created_at: string | null
description: string | null
id: string
@@ -112,7 +113,8 @@ export type Database = {
wifi: string
}
Insert: {
building_location?: string | null
building_location?: Json | null
building_location_old?: string | null
created_at?: string | null
description?: string | null
id?: string
@@ -124,7 +126,8 @@ export type Database = {
wifi: string
}
Update: {
building_location?: string | null
building_location?: Json | null
building_location_old?: string | null
created_at?: string | null
description?: string | null
id?: string

View File

@@ -1,3 +1,4 @@
import { PUBLIC_GMAPS_API_KEY } from "$env/static/public";
import type { Database } from "./database.d.ts";
export type Table<T extends keyof Database["public"]["Tables"]> =
@@ -30,3 +31,12 @@ export const reportTypes = [
"Incorrect content",
"Other"
];
export async function gmapsLoader() {
const { Loader } = await import("@googlemaps/js-api-loader");
return new Loader({
apiKey: PUBLIC_GMAPS_API_KEY,
version: "weekly",
libraries: ["places"]
});
}