import { Component, Input } from '@angular/core';
import { Router } from '@angular/router';

@Component({
	selector: 'app-options',
	templateUrl: './options.component.html',
	styleUrls: ['./options.component.css'],
})
export class OptionsComponent {
	@Input() mode: 'modal' | 'full' = 'full';

	constructor(private router: Router) {}

	ngOnInit(): void {
		const nav = this.router.getCurrentNavigation();
		const state = nav?.extras?.state as { mode: 'modal' | 'full' };
		this.mode = state?.mode || 'full';
	}
}
