refactor(frontend): extract reusable hooks and page helper modules

This commit is contained in:
Sagit
2026-02-19 05:14:11 +00:00
parent 6d57b49595
commit c5124a01e6
24 changed files with 2072 additions and 0 deletions
@@ -0,0 +1,42 @@
import { Spinner } from "@/shadcn-bridge/heroui/spinner";
interface BaseStateProps {
message: string;
className?: string;
}
export const PageLoadingState = ({
message,
className = "h-64",
}: BaseStateProps) => {
return (
<div className={`flex items-center justify-center ${className}`}>
<div className="flex items-center gap-3">
<Spinner size="sm" />
<span className="text-default-600">{message}</span>
</div>
</div>
);
};
export const PageEmptyState = ({
message,
className = "h-48",
}: BaseStateProps) => {
return (
<div className={`flex items-center justify-center ${className}`}>
<span className="text-default-500">{message}</span>
</div>
);
};
export const PageErrorState = ({
message,
className = "h-48",
}: BaseStateProps) => {
return (
<div className={`flex items-center justify-center ${className}`}>
<span className="text-danger">{message}</span>
</div>
);
};