import { type PerspectiveCameraProps } from "@react-three/drei";

export const views: PerspectiveCameraProps[] = [
  {
    // MainView
    position: [-21.795, 24.75, 21.239],
    rotation: [-Math.PI / 4, -0.61087, -Math.PI / 6],
  },
  {
    // PrinterView
    position: [-6.6, 6.25, 2.521],
    rotation: [-0.24997, -0.49109, -0.11983],
  },
  {
    // ResumeView
    position: [2.845, 6, 6.454],
    rotation: [-Math.PI / 2, 0, -2.34921],
  },
  {
    // PCView
    position: [1.25, 5.9822, 1.725],
    rotation: [0, -Math.PI / 2, 0],
  },
  {
    // CellphoneView
    position: [2.3584, 5.6, -2.0546],
    rotation: [-Math.PI / 2, 0, -1.13795],
  },
  {
    // DesktopView
    position: [-3, 10.35, 5.8],
    rotation: [-Math.PI / 4, -0.61087, -Math.PI / 6],
  },
  {
    // PhoneView
    position: [3.0143, 5.5, 6.0997],
    rotation: [-2.55743, -0.69621, -2.74104],
  },
  {
    // CreditsView
    position: [1.25, 5.9822, -2.075],
    rotation: [0, -Math.PI / 2, 0],
  },
] as const;

export enum View {
  MainView = 0,
  PrinterView = 1,
  ResumeView = 2,
  PCView = 3,
  CellphoneView = 4,
  DesktopView = 5,
  PhoneView = 6,
  CreditsView = 7,
}

export const hashtoView: Record<string, View> = {
  hobbies: View.PrinterView,
  resume: View.ResumeView,
  projects: View.PCView,
  socials: View.CellphoneView,
  contact: View.PhoneView,
};

export const viewToHash = Object.fromEntries(
  Object.entries(hashtoView).map(([hash, view]) => [view, hash])
) as Record<View, string>;
