Kavita/UI/Web/src/app/settings/_components/setting-switch/setting-switch.component.ts
Robbie Davis ff79710ac6
UX Overhaul Part 1 (#3047)
Co-authored-by: Joseph Milazzo <joseph.v.milazzo@gmail.com>
2024-08-09 10:55:31 -07:00

33 lines
903 B
TypeScript

import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component, ContentChild,
inject,
Input,
TemplateRef
} from '@angular/core';
import {NgTemplateOutlet} from "@angular/common";
import {TranslocoDirective} from "@ngneat/transloco";
import {SafeHtmlPipe} from "../../../_pipes/safe-html.pipe";
@Component({
selector: 'app-setting-switch',
standalone: true,
imports: [
NgTemplateOutlet,
TranslocoDirective,
SafeHtmlPipe
],
templateUrl: './setting-switch.component.html',
styleUrl: './setting-switch.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class SettingSwitchComponent {
private readonly cdRef = inject(ChangeDetectorRef);
@Input({required:true}) title: string = '';
@Input() subtitle: string | undefined = undefined;
@Input() id: string | undefined = undefined;
@ContentChild('switch') switchRef!: TemplateRef<any>;
}