feat: google maps
This commit is contained in:
@@ -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 {
|
||||
|
||||
9
src/lib/database.d.ts
vendored
9
src/lib/database.d.ts
vendored
@@ -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
|
||||
|
||||
@@ -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"]
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user