Fix person list skeleton

This commit is contained in:
2025-03-08 14:50:02 -05:00
parent b763a1c7bd
commit 90337f92ab
2 changed files with 74 additions and 3 deletions

View File

@@ -27,7 +27,7 @@ export default function PrimaryButton(props: ButtonProps){
"text-white": variant === "solid",
"text-blue-600 hover:text-blue-700 active:text-blue-800": (variant === "outline" || variant === "icon") && (!disabled),
"text-blue-400/80": (variant === "outline" || variant === "icon") && (disabled),
"text-blue-600 hover:text-white active:text-white": variant === "ghost" || variant === "outline-ghost",
"text-blue-600 hover:text-white active:text-white": (variant === "ghost" || variant === "outline-ghost") && (!disabled),
"text-blue-400/80 ": (variant === "ghost" || variant === "outline-ghost") && (disabled)
},
//Outline

View File

@@ -1,7 +1,78 @@
import { ButtonShape, ButtonSizeType, ButtonVariant } from "@/components/button/Button";
import Table from "@/components/table/Table";
import { elementBg } from "@/util/SkeletonUtil";
import React from "react";
import PersonAdminButtons from "./PersonAdminButtons";
export default function PersonListSkeleton(){
return (
const headElements: React.ReactNode[] = [
<div>
Person List Skeleton
Person Name
</div>,
<div>
Discord ID
</div>,
<div>
Characters
</div>,
<div
className="pl-16"
>
Actions
</div>
];
const bodyElements: React.ReactNode[][] = [
PersonSkeleton(),
PersonSkeleton(),
PersonSkeleton(),
PersonSkeleton(),
PersonSkeleton(),
PersonSkeleton(),
PersonSkeleton(),
PersonSkeleton(),
PersonSkeleton(),
PersonSkeleton()
];
return (
<Table
tableHeadElements={headElements}
tableBodyElements={bodyElements}
/>
);
}
export function PersonSkeleton(): React.ReactNode[]{
const buttonsProps = {
buttonProps: {
variant: "ghost" as ButtonVariant,
size: "md" as ButtonSizeType,
shape: "square" as ButtonShape,
disabled: true
},
showUpdatePersonModal: () => {},
showDeletePersonModal: () => {},
showCreatePersonCharacterModal: () => {}
}
const elements: React.ReactNode[] = [
<div
className={`h-6 w-64 mr-1 ${elementBg}`}
/>,
<div
className={`h-6 w-48 ml-2 ${elementBg}`}
/>,
<div
className={`h-6 w-[48rem] ${elementBg}`}
/>,
<div
className={`flex flex-row items-center justify-center gap-2 pl-16`}
>
<div className="py-4 border-l border-neutral-500">&nbsp;</div>
<PersonAdminButtons {...buttonsProps}/>
</div>
];
return elements;
}