mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-01 08:36:38 +08:00
refactor(frontend): extract reusable hooks and page helper modules
This commit is contained in:
@@ -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>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user