2025-02-25 06:40:06 +00:00
|
|
|
import { FileTextIcon, FlaskConicalIcon } from "lucide-react";
|
2025-02-23 11:17:03 +00:00
|
|
|
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
|
|
|
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
|
|
|
|
2025-02-24 11:16:31 +00:00
|
|
|
interface ProblemLayoutProps {
|
2025-02-24 11:55:17 +00:00
|
|
|
description: React.ReactNode;
|
2025-02-25 06:40:06 +00:00
|
|
|
solution: React.ReactNode;
|
2025-02-23 11:17:03 +00:00
|
|
|
}
|
|
|
|
|
2025-02-25 06:40:06 +00:00
|
|
|
export default function ProblemLayout({
|
|
|
|
description,
|
|
|
|
solution,
|
|
|
|
}: ProblemLayoutProps) {
|
2025-02-23 11:17:03 +00:00
|
|
|
return (
|
2025-02-24 04:32:03 +00:00
|
|
|
<Tabs defaultValue="description" className="h-full flex flex-col">
|
2025-02-24 04:38:54 +00:00
|
|
|
<ScrollArea className="h-9 flex-none bg-muted px-1">
|
2025-02-23 11:17:03 +00:00
|
|
|
<TabsList className="gap-1 bg-transparent">
|
|
|
|
<TabsTrigger
|
|
|
|
value="description"
|
|
|
|
className="data-[state=active]:bg-primary data-[state=active]:text-primary-foreground rounded-full data-[state=active]:shadow-none"
|
|
|
|
>
|
|
|
|
<FileTextIcon
|
|
|
|
className="-ms-0.5 me-1.5 opacity-60"
|
|
|
|
size={16}
|
|
|
|
aria-hidden="true"
|
|
|
|
/>
|
|
|
|
Description
|
|
|
|
</TabsTrigger>
|
2025-02-25 06:40:06 +00:00
|
|
|
<TabsTrigger
|
|
|
|
value="solution"
|
|
|
|
className="data-[state=active]:bg-primary data-[state=active]:text-primary-foreground rounded-full data-[state=active]:shadow-none"
|
|
|
|
>
|
|
|
|
<FlaskConicalIcon
|
|
|
|
className="-ms-0.5 me-1.5 opacity-60"
|
|
|
|
size={16}
|
|
|
|
aria-hidden="true"
|
|
|
|
/>
|
|
|
|
Solution
|
|
|
|
</TabsTrigger>
|
2025-02-23 11:17:03 +00:00
|
|
|
</TabsList>
|
|
|
|
<ScrollBar orientation="horizontal" />
|
|
|
|
</ScrollArea>
|
2025-02-26 01:53:43 +00:00
|
|
|
<TabsContent value="description" className="flex-1 mt-0">
|
2025-02-24 11:55:17 +00:00
|
|
|
{description}
|
2025-02-23 11:17:03 +00:00
|
|
|
</TabsContent>
|
2025-02-26 01:53:43 +00:00
|
|
|
<TabsContent value="solution" className="flex-1 mt-0">
|
2025-02-25 06:40:06 +00:00
|
|
|
{solution}
|
|
|
|
</TabsContent>
|
2025-02-23 11:17:03 +00:00
|
|
|
</Tabs>
|
|
|
|
);
|
|
|
|
}
|