"use server";

import { getGiteaActivity } from "@/components/gitea";
import { getStravaActivityStats } from "@/components/strava";
import React from "react";

export default async function App() {
  const strava = await getStravaActivityStats();
  const gitea = await getGiteaActivity();
  return (
    <>
      hi,
      <br />
      <br /> how nice of you to stop by.
      <br />
      <br /> this cute little site is my own little playground. my own corner of
      the web for me to share and show off.
      <br />
      <br /> feel free to poke around and see what you find.
      <br />
      <br /> &mdash; naresh
      <br />
      {JSON.stringify(gitea)}
      <div
        style={{
          marginTop: "2rem",
          borderTopStyle: "dashed",
          borderTopWidth: "1px",
        }}
      >
        <div style={{ fontSize: "0.8rem" }}>
          recent rides: {strava.rides.toFixed(1)} km
          {strava.runs >= 5 && (
            <>
              <br />
              recent runs: {strava.runs.toFixed(1)} km
            </>
          )}
        </div>
      </div>
    </>
  );
}
