Spaces:
Running
Running
File size: 7,129 Bytes
c10f8f8 de197ce c10f8f8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
import classNames from "classnames";
import { ChevronRight, RefreshCcw } from "lucide-react";
import { useState } from "react";
import { TailwindColors } from "./tailwind-colors";
import { Switch } from "@/components/ui/switch";
import { Button } from "@/components/ui/button";
import { Themes } from "./themes";
import { EnhancedSettings } from "@/types";
export const ContentModal = ({
enhancedSettings,
setEnhancedSettings,
}: {
enhancedSettings: EnhancedSettings;
setEnhancedSettings: (settings: EnhancedSettings) => void;
}) => {
const [collapsed, setCollapsed] = useState(["colors", "theme"]);
return (
<main className="overflow-x-hidden max-h-[50dvh] overflow-y-auto">
<section className="w-full border-b border-neutral-800/80 px-6 py-3.5 sticky top-0 bg-neutral-900 z-10">
<div className="flex items-center justify-between gap-3">
<p className="text-base font-semibold text-neutral-200">
Allow DeepSite to enhance your prompt
</p>
<Switch
checked={enhancedSettings.isActive}
onCheckedChange={() =>
setEnhancedSettings({
...enhancedSettings,
isActive: !enhancedSettings.isActive,
})
}
/>
</div>
<p className="text-sm text-neutral-500 mt-2">
While using DeepSite enhanced prompt, you'll get better results. We'll
add more details and features to your request.
</p>
<div className="text-sm text-sky-500 mt-3 bg-gradient-to-r from-sky-400/15 to-purple-400/15 rounded-md px-3 py-2 border border-white/10">
<p className="text-transparent bg-gradient-to-r from-sky-400 to-purple-400 bg-clip-text">
You can also use the custom properties below to set specific
information.
</p>
</div>
</section>
<section className="py-3.5 border-b border-neutral-800/80">
<div
className={classNames(
"flex items-center justify-start gap-3 px-4 cursor-pointer text-neutral-400 hover:text-neutral-200",
{
"!text-neutral-200": collapsed.includes("colors"),
}
)}
onClick={() =>
setCollapsed((prev) => {
if (prev.includes("colors")) {
return prev.filter((item) => item !== "colors");
}
return [...prev, "colors"];
})
}
>
<ChevronRight className="size-4" />
<p className="text-base font-semibold">Colors</p>
</div>
{collapsed.includes("colors") && (
<div className="mt-4 space-y-4">
<article className="w-full">
<div className="flex items-center justify-start gap-2 px-5">
<p className="text-xs font-medium uppercase text-neutral-400">
Primary Color
</p>
<Button
variant="bordered"
size="xss"
className={`${
enhancedSettings.primaryColor ? "" : "opacity-0"
}`}
onClick={() =>
setEnhancedSettings({
...enhancedSettings,
primaryColor: undefined,
})
}
>
<RefreshCcw className="size-2.5" />
Reset
</Button>
</div>
<div className="text-muted-foreground text-sm mt-4">
<TailwindColors
value={enhancedSettings.primaryColor}
onChange={(value) =>
setEnhancedSettings({
...enhancedSettings,
primaryColor: value,
})
}
/>
</div>
</article>
<article className="w-full">
<div className="flex items-center justify-start gap-2 px-5">
<p className="text-xs font-medium uppercase text-neutral-400">
Secondary Color
</p>
<Button
variant="bordered"
size="xss"
className={`${
enhancedSettings.secondaryColor ? "" : "opacity-0"
}`}
onClick={() =>
setEnhancedSettings({
...enhancedSettings,
secondaryColor: undefined,
})
}
>
<RefreshCcw className="size-2.5" />
Reset
</Button>
</div>
<div className="text-muted-foreground text-sm mt-4">
<TailwindColors
value={enhancedSettings.secondaryColor}
onChange={(value) =>
setEnhancedSettings({
...enhancedSettings,
secondaryColor: value,
})
}
/>
</div>
</article>
</div>
)}
</section>
<section className="py-3.5 border-b border-neutral-800/80">
<div
className={classNames(
"flex items-center justify-start gap-3 px-4 cursor-pointer text-neutral-400 hover:text-neutral-200",
{
"!text-neutral-200": collapsed.includes("theme"),
}
)}
onClick={() =>
setCollapsed((prev) => {
if (prev.includes("theme")) {
return prev.filter((item) => item !== "theme");
}
return [...prev, "theme"];
})
}
>
<ChevronRight className="size-4" />
<p className="text-base font-semibold">Theme</p>
</div>
{collapsed.includes("theme") && (
<article className="w-full mt-4">
<div className="flex items-center justify-start gap-2 px-5">
<p className="text-xs font-medium uppercase text-neutral-400">
Theme
</p>
<Button
variant="bordered"
size="xss"
className={`${enhancedSettings.theme ? "" : "opacity-0"}`}
onClick={() =>
setEnhancedSettings({
...enhancedSettings,
theme: undefined,
})
}
>
<RefreshCcw className="size-2.5" />
Reset
</Button>
</div>
<div className="text-muted-foreground text-sm mt-4">
<Themes
value={enhancedSettings.theme}
onChange={(value) =>
setEnhancedSettings({
...enhancedSettings,
theme: value,
})
}
/>
</div>
</article>
)}
</section>
</main>
);
};
|