feat(layout): add footer components for ProblemDescription and ProblemSolution layouts

This commit is contained in:
cfngc4594 2025-02-26 11:44:54 +08:00
parent 037f8f625d
commit b39350d5a7
4 changed files with 54 additions and 2 deletions

View File

@ -0,0 +1,21 @@
import { cn } from "@/lib/utils";
interface ProblemDescriptionFooterProps {
className?: string;
}
export default function ProblemDescriptionFooter({
className,
...props
}: ProblemDescriptionFooterProps) {
return (
<footer
{...props}
className={cn("h-9 flex flex-none items-center bg-muted", className)}
>
<div className="w-full flex items-center justify-center">
Description of Two Sum
</div>
</footer>
);
}

View File

@ -1,3 +1,5 @@
import ProblemDescriptionFooter from "./components/footer";
interface ProblemDescriptionLayoutProps {
children: React.ReactNode;
}
@ -7,7 +9,10 @@ export default function ProblemDescriptionLayout({
}: ProblemDescriptionLayoutProps) {
return (
<div className="h-full flex flex-col">
{children}
<div className="flex-1">
{children}
</div>
<ProblemDescriptionFooter />
</div>
);
}

View File

@ -0,0 +1,21 @@
import { cn } from "@/lib/utils";
interface ProblemSolutionFooterProps {
className?: string;
}
export default function ProblemSolutionFooter({
className,
...props
}: ProblemSolutionFooterProps) {
return (
<footer
{...props}
className={cn("h-9 flex flex-none items-center bg-muted", className)}
>
<div className="w-full flex items-center justify-center">
Solution of Two Sum
</div>
</footer>
);
}

View File

@ -1,3 +1,5 @@
import ProblemSolutionFooter from "./components/footer";
interface ProblemSolutionLayoutProps {
children: React.ReactNode;
}
@ -7,7 +9,10 @@ export default function ProblemSolutionLayout({
}: ProblemSolutionLayoutProps) {
return (
<div className="h-full flex flex-col">
{children}
<div className="flex-1">
{children}
</div>
<ProblemSolutionFooter />
</div>
);
}