Add roll-call Start/Stop UX to business and customer dashboards.

Owners/admins can run timed work days, manage tasks in a modal, and stop from the FAB or row control.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-10-07 13:21:07 +03:30
co-authored by Cursor
parent ac287e02cc
commit c4e846564e
30 changed files with 4063 additions and 83 deletions
+20 -1
View File
@@ -1,6 +1,17 @@
import type { BusinessCategory } from '../types/category'
import type { MultiSelectOption } from '../components/MultiSelectDropdown'
/** Match IranBay: "English / فارسی" when both exist. */
export function businessCategoryLabel(
category: Pick<BusinessCategory, 'name' | 'nameFa'>,
) {
const nameFa = category.nameFa?.trim()
if (nameFa && nameFa !== category.name) {
return `${category.name} / ${nameFa}`
}
return category.name
}
export function flattenBusinessCategories(
categories: BusinessCategory[],
): MultiSelectOption<number>[] {
@@ -12,7 +23,15 @@ export function flattenBusinessCategories(
.sort((a, b) => a.sortOrder - b.sortOrder || a.name.localeCompare(b.name))
for (const child of children) {
result.push({ value: child.id, label: child.name, depth })
const keywords = [child.name, child.nameFa ?? '', child.slug, ...(child.tags ?? [])]
.join(' ')
.trim()
result.push({
value: child.id,
label: businessCategoryLabel(child),
depth,
keywords,
})
walk(child.id, depth + 1)
}
}