How to access a D1 binding from a next.js tsx file (NOT .ts)?

In my next on pages app, I got a db call working on a .ts file but I'm wondering how I access that data within a tsx page? I've read all the documentation but I don't see any next.js examples of calling data within a .tsx server component, only from a .ts file (which I can't import bc of this error in the screenshot).

Open to any suggestions :PES_CryHug:

"use client"
import { useState, useEffect } from 'react';
import { GET } from './api/all/route'

export const runtime = 'edge'
export default function Home() {

  const [title, setTitle] = useState('');
  const [data, setData] = useState();

  useEffect(() => {
    GET().then((data: any) => {
      setData(data.target.value);
    });
  }, []);


  function handleTitleChange(e: any) {
    setTitle(e.target.value)
  }

  return (
    <div>
      <p>{data}</p>
    </div>
  );
}
Was this page helpful?