Basic table component
Some checks failed
Check usage of free licenses / build-static-assets (pull_request) Successful in 53s
Playwright Tests / test (pull_request) Failing after 1m19s
Add copyright notice / copyright_notice (pull_request) Successful in 1m34s
Build Nginx-based docker image / build-static-assets (pull_request) Failing after 8m48s
Some checks failed
Check usage of free licenses / build-static-assets (pull_request) Successful in 53s
Playwright Tests / test (pull_request) Failing after 1m19s
Add copyright notice / copyright_notice (pull_request) Successful in 1m34s
Build Nginx-based docker image / build-static-assets (pull_request) Failing after 8m48s
This commit is contained in:
parent
718e6d22c6
commit
e83e2dc37a
@ -1,12 +1,59 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
/* Copyright (C) 2024 Manuel Bustillo*/
|
||||||
|
|
||||||
|
import { Table } from '@/app/ui/components/table';
|
||||||
|
import Summary from '@/app/ui/expenses/summary';
|
||||||
import { lusitana } from '@/app/ui/fonts';
|
import { lusitana } from '@/app/ui/fonts';
|
||||||
|
|
||||||
export default function Page () {
|
export default function Page() {
|
||||||
return (
|
return (
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<div className="flex w-full items-center justify-between">
|
<div className="w-full items-center justify-between">
|
||||||
<h1 className={`${lusitana.className} text-2xl`}>Table distributions</h1>
|
<h1 className={`${lusitana.className} text-2xl`}>Table distributions</h1>
|
||||||
|
<div className="flex flex-row flex-wrap justify-around">
|
||||||
|
<Table guests={
|
||||||
|
[
|
||||||
|
{ name: "George Orwell", id: "1" },
|
||||||
|
{ name: "Aldous Huxley", id: "2" },
|
||||||
|
{ name: "Isaac Asimov", id: "3" },
|
||||||
|
{ name: "Arthur C. Clarke", id: "4" },
|
||||||
|
{ name: "Philip Roth", id: "5" },
|
||||||
|
{ name: "Kurt Vonnegut", id: "6" },
|
||||||
|
{ name: "Ray Bradbury", id: "7" },
|
||||||
|
{ name: "Jorge Luis Borges", id: "8" },
|
||||||
|
{ name: "Gabriel García Márquez", id: "9" },
|
||||||
|
{ name: "Julio Cortázar", id: "10" },
|
||||||
|
]
|
||||||
|
} />
|
||||||
|
<Table guests={
|
||||||
|
[
|
||||||
|
{ name: "George Orwell", id: "1" },
|
||||||
|
{ name: "Aldous Huxley", id: "2" },
|
||||||
|
{ name: "Isaac Asimov", id: "3" },
|
||||||
|
{ name: "Arthur C. Clarke", id: "4" },
|
||||||
|
{ name: "Philip Roth", id: "5" },
|
||||||
|
{ name: "Kurt Vonnegut", id: "6" },
|
||||||
|
{ name: "Ray Bradbury", id: "7" },
|
||||||
|
{ name: "Jorge Luis Borges", id: "8" },
|
||||||
|
{ name: "Gabriel García Márquez", id: "9" },
|
||||||
|
{ name: "Julio Cortázar", id: "10" },
|
||||||
|
]
|
||||||
|
} />
|
||||||
|
<Table guests={
|
||||||
|
[
|
||||||
|
{ name: "George Orwell", id: "1" },
|
||||||
|
{ name: "Aldous Huxley", id: "2" },
|
||||||
|
{ name: "Isaac Asimov", id: "3" },
|
||||||
|
{ name: "Arthur C. Clarke", id: "4" },
|
||||||
|
{ name: "Philip Roth", id: "5" },
|
||||||
|
{ name: "Kurt Vonnegut", id: "6" },
|
||||||
|
{ name: "Ray Bradbury", id: "7" },
|
||||||
|
{ name: "Jorge Luis Borges", id: "8" },
|
||||||
|
{ name: "Gabriel García Márquez", id: "9" },
|
||||||
|
{ name: "Julio Cortázar", id: "10" },
|
||||||
|
]
|
||||||
|
} />
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -21,9 +21,9 @@ export type Customer = {
|
|||||||
export type Guest = {
|
export type Guest = {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
email: string;
|
email?: string;
|
||||||
group_name: string;
|
group_name?: string;
|
||||||
status: 'Considered' | 'Invited' | 'Confirmed' | 'Declined' | 'Tentative';
|
status?: 'Considered' | 'Invited' | 'Confirmed' | 'Declined' | 'Tentative';
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Group = {
|
export type Group = {
|
||||||
|
@ -1,5 +1,31 @@
|
|||||||
export function Table() {
|
import { Guest } from "@/app/lib/definitions";
|
||||||
return(
|
|
||||||
<div>I am a table</div>
|
|
||||||
|
function GuestRow({ guests }: { guests: Guest[] }) {
|
||||||
|
return (<div className="justify-around flex flex-row">
|
||||||
|
{
|
||||||
|
guests.map((guest) => {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="m-3 w-24 h-24 rounded-full bg-neutral-400 hover:bg-neutral-500 content-center text-center">
|
||||||
|
{guest.name}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
</div>)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function Table({ guests }: { guests: Guest[] }) {
|
||||||
|
const halfwayThrough = Math.floor(guests.length / 2)
|
||||||
|
const arrayFirstHalf = guests.slice(0, halfwayThrough);
|
||||||
|
const arraySecondHalf = guests.slice(halfwayThrough, guests.length);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="m-12 h-64 bg-neutral-300 flex flex-col justify-between">
|
||||||
|
<GuestRow guests={arrayFirstHalf} />
|
||||||
|
<GuestRow guests={arraySecondHalf} />
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user