@if (isLoading) {
}
Category Management
@if (categories$ | async; as categories) { @if (categories.length > 0 || selectedCategory) {
Category ID
Name
Actions
@if (selectedCategory && !selectedCategory.id) {
Auto-generated
New Category
} @for (category of categories; track trackByFn($index, category)) {
{{ category.category_id }}
{{ category.name }}
@if (selectedCategory?.id === category.id) {
} }
} @else {

No categories found

Get started by creating your first category

} }

{{ category.id ? 'Edit Category' : 'Create New Category' }}

@if (category.category_id) {

Category ID: {{ category.category_id }}

} @else {

Category ID will be auto-generated from name

}
Category Name Name is required ID will be: {{ previewCategoryId }} Branch {{ branch.name }} ({{ branch.code }}) Branch is required Branch ID Auto-filled from branch selection Branch Name Auto-filled from branch selection Brand @if (!selectedBranchId) { Select branch first } {{ brand.name }} Brand is required Brands filtered by selected branch Brand ID Auto-filled from brand selection @if (category.id && category.created_by_username) { Created By }
@if (imagePreview || category.image) { } @else {
}

PNG, JPG, GIF up to 5MB

@if (imagePreview || category.image) { }
@if (category.id) {
Created: {{ category.created_at | date:'medium' }}
@if (category.updated_at && category.updated_at !== category.created_at) {
Last Updated: {{ category.updated_at | date:'medium' }}
}
}
@if (flashMessage) {
@if (flashMessage === 'success') { {{ category.id ? 'Updated' : 'Created' }} successfully } @if (flashMessage === 'error') { Error occurred }
}