2025-03-03 07:10:06 +00:00
|
|
|
"use client";
|
|
|
|
|
2025-02-26 13:54:49 +00:00
|
|
|
import { cn } from "@/lib/utils";
|
2025-03-03 07:10:06 +00:00
|
|
|
import { useState } from "react";
|
2025-03-08 13:16:57 +00:00
|
|
|
import RunCode from "@/components/run-code";
|
|
|
|
import SettingsButton from "@/components/settings-button";
|
|
|
|
import { SettingsDialog } from "@/components/settings-dialog";
|
2025-02-26 13:54:49 +00:00
|
|
|
|
2025-03-08 13:16:57 +00:00
|
|
|
interface PlaygroundHeaderProps {
|
2025-02-26 13:54:49 +00:00
|
|
|
className?: string;
|
|
|
|
}
|
|
|
|
|
2025-03-08 13:16:57 +00:00
|
|
|
export function PlaygroundHeader({
|
2025-02-26 13:54:49 +00:00
|
|
|
className,
|
|
|
|
...props
|
2025-03-08 13:16:57 +00:00
|
|
|
}: PlaygroundHeaderProps) {
|
2025-03-03 07:10:06 +00:00
|
|
|
const [isDialogOpen, setDialogOpen] = useState(false);
|
|
|
|
|
|
|
|
const toggleDialog = () => {
|
|
|
|
setDialogOpen(!isDialogOpen);
|
|
|
|
};
|
|
|
|
|
2025-02-26 13:54:49 +00:00
|
|
|
return (
|
|
|
|
<header
|
|
|
|
{...props}
|
2025-03-03 03:40:05 +00:00
|
|
|
className={cn("relative", className)}
|
2025-02-26 13:54:49 +00:00
|
|
|
>
|
2025-03-03 03:40:05 +00:00
|
|
|
<nav className="relative h-12 w-full flex shrink-0 items-center px-2.5">
|
|
|
|
<div className="w-full flex justify-between">
|
|
|
|
<div className="w-full flex items-center justify-between">
|
|
|
|
<div className="flex items-center"></div>
|
2025-03-09 07:14:47 +00:00
|
|
|
<div className="relative z-10 flex items-center gap-2">
|
2025-03-03 07:10:06 +00:00
|
|
|
<SettingsButton onClick={toggleDialog} />
|
2025-03-03 03:40:05 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</nav>
|
2025-03-09 07:14:47 +00:00
|
|
|
<div className="absolute left-0 right-0 top-0 h-full mx-auto py-2">
|
|
|
|
<div className="relative flex justify-center">
|
2025-03-03 03:40:05 +00:00
|
|
|
<div className="relative flex overflow-hidden rounded">
|
2025-03-10 15:10:56 +00:00
|
|
|
<RunCode className="bg-muted text-muted-foreground hover:bg-muted/50" />
|
2025-03-03 03:40:05 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2025-03-03 07:10:06 +00:00
|
|
|
<SettingsDialog open={isDialogOpen} onClose={toggleDialog} />
|
2025-02-26 13:54:49 +00:00
|
|
|
</header>
|
|
|
|
);
|
|
|
|
}
|