feature(dashboard): actually add password production to overviews

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-01-21 15:19:50 +00:00
parent 08bfff94cf
commit f216a7b9c5
7 changed files with 192 additions and 39 deletions

View File

@@ -0,0 +1,28 @@
import type { Dispatch, SetStateAction } from 'react';
import AnimateHeight from '../animate-height';
import { Label } from './label';
import { Switch } from './switch';
type Props = {
active: boolean;
onActiveChange: (newValue: boolean) => void;
label: string;
children: React.ReactNode;
};
export function InputWithToggle({
active,
onActiveChange,
label,
children,
}: Props) {
return (
<div className="col gap-2">
<div className="flex gap-2 items-center justify-between">
<Label className="mb-0">{label}</Label>
<Switch checked={active} onCheckedChange={onActiveChange} />
</div>
<AnimateHeight open={active}>{children}</AnimateHeight>
</div>
);
}