"use client"
import { Panel } from "@/app/interface/panel"
import { pick } from "@/lib/pick"
import { Grid } from "@/app/interface/grid"
import { LayoutProps } from "@/types"
import { NB_PANELS_PER_PAGE } from "@/config"
export function Layout0({ page, nbPanels }: LayoutProps) {
return (
)
}
export function Layout1({ page, nbPanels }: LayoutProps) {
return (
)
}
export function Layout2_todo({ page, nbPanels }: LayoutProps) {
return (
)
}
export function Layout3_todo({ page, nbPanels }: LayoutProps) {
return (
)
}
export function Layout4_todo({ page, nbPanels }: LayoutProps) {
return (
)
}
export function Layout2({ page, nbPanels }: LayoutProps) {
return (
)
}
export function Layout3({ page, nbPanels }: LayoutProps) {
return (
)
}
// squares + vertical
export function Layout4({ page, nbPanels }: LayoutProps) {
return (
)
}
// squares + horizontal
export function Layout5({ page, nbPanels }: LayoutProps) {
return (
)
}
// export const layouts = { Layout1, Layout2_todo, Layout3_todo, Layout4_todo, Layout2, Layout3 }
export const allLayouts = {
random: <>>,
Layout0,
Layout1,
Layout2,
Layout3,
Layout4
}
export const allLayoutLabels = {
random: "Random layout",
Layout0: "Grid 0",
Layout1: "Grid 1",
Layout2: "Grid 2",
Layout3: "Grid 3",
// Layout4: "Blocks 1",
}
// note for reference: A4 (297mm x 210mm)
export const allLayoutAspectRatios = {
Layout0: "aspect-[250/297]",
Layout1: "aspect-[250/297]",
Layout2: "aspect-[250/297]",
Layout3: "aspect-[250/297]",
// Layout4: "aspect-[1/3]",
}
export const allLayoutsNbPanels = {
// TODO: this is gonna be tricky to implement, but this should be unique / dynamic
Layout0: NB_PANELS_PER_PAGE,
Layout1: NB_PANELS_PER_PAGE,
Layout2: NB_PANELS_PER_PAGE,
Layout3: NB_PANELS_PER_PAGE,
// Layout4: NB_PANELS_PER_PAGE
}
export type LayoutName = keyof typeof allLayouts
export const defaultLayout: LayoutName = "Layout1"
export type LayoutCategory = "square" | "fluid"
export const nonRandomLayouts = Object.keys(allLayouts).filter(layout => layout !== "random")
export const getRandomLayoutName = (): LayoutName => {
return pick(nonRandomLayouts) as LayoutName
}
export function getRandomLayoutNames(): LayoutName[] {
return nonRandomLayouts.sort(() => Math.random() - 0.5) as LayoutName[]
}