Added impersonation for admins

This commit is contained in:
Tom
2024-01-04 21:57:32 +00:00
parent 320c826684
commit 8f7f18e069
25 changed files with 494 additions and 131 deletions

View File

@ -14,7 +14,7 @@ import { Label } from "@/components/ui/label";
import { Checkbox } from "@/components/ui/checkbox";
import voices from "@/data/tts";
const TTSFiltersPage = () => {
const TTSVoiceFiltersPage = () => {
const { data: session, status } = useSession();
const [loading, setLoading] = useState<boolean>(true)
@ -88,7 +88,7 @@ const TTSFiltersPage = () => {
<CommandGroup>
{voices.map((voice) => (
<CommandItem
key={voice.value}
key={voice.value + "-" + voice.label}
value={voice.value}
onSelect={(currentValue) => {
setValue(Number.parseInt(currentValue))
@ -115,7 +115,7 @@ const TTSFiltersPage = () => {
<p className="text-xl text-center justify-center">Voices Enabled</p>
<div className="grid grid-cols-4 grid-flow-row gap-4 pt-[20px]">
{voices.map((v, i) => (
<div className="h-[30px] row-span-1 col-span-1 align-middle flex items-center justify-center">
<div key={v.label + "-enabled"} className="h-[30px] row-span-1 col-span-1 align-middle flex items-center justify-center">
<Checkbox onClick={() => {
const newVal = enabled ^ (1 << (Number.parseInt(v.value) - 1))
setEnabled(newVal)
@ -132,4 +132,4 @@ const TTSFiltersPage = () => {
);
}
export default TTSFiltersPage;
export default TTSVoiceFiltersPage;