import * as React from "react"
import { Override, Frame } from "framer"
import { PlacesController } from "framer-controller"
import { Prediction } from "./canvas"
const controller = new PlacesController({
apiKey: "YOUR_GOOGLE_PLACES_API_KEY",
export const PlacesInput: Override = () => ({
controller.getPlacePredictions(v)
controller.clearPredictions()
export const PredictionContainer: Override = () => ({
children: controller.predictions.map((p, i) => (
onClick={() => controller.getPlaceDetails(p.place_id)}
<Prediction $value={p.description} width={"100%"} />
export const ViewDetailsLink: Override = props => ({
top: controller.predictions.length === 0 ? 2000 : props.top,
export const ViewDetailsButton: Override = () => ({
disabled: controller.predictions.length === 0,
export const DetailsLabel: Override = () => {
const { details } = controller
`${details.geometry.location
.toFixed(2)}, ${details.geometry.location.lat().toFixed(2)}`,