import type { Route } from './+types/home'

import { Button } from '@repo/ui/components/ui/button'

export function meta({}: Route.MetaArgs) {
  return [
    { title: 'New React Router App' },
    { name: 'description', content: 'Welcome to React Router!' }
  ]
}

export function loader({ context }: Route.LoaderArgs) {
  return { message: context.cloudflare.env.VALUE_FROM_CLOUDFLARE }
}

export default function Home({ loaderData }: Route.ComponentProps) {
  return (
    <>
      <Button>{loaderData.message}</Button>
    </>
  )
}
