import type { PageLoad } from './$types';
import type { User } from '$lib/api/types';
import { readUser } from '$lib/api/endpoints';

export const ssr = false;
export const load = (async ({ params }) => {
  // check if user exists
  const userId = params.user;
  const user = await readUser(userId);
  return {
    user: user
  };

}) satisfies PageLoad;

export interface UserProfilePage {
  user: User
}
