feat: improve quick actions and remote access

This commit is contained in:
Esdras Renan 2025-11-18 21:16:00 -03:00
parent aeb6d50377
commit 4f8dad2255
10 changed files with 906 additions and 154 deletions

View file

@ -100,7 +100,7 @@ type Props = {
type ViewMode = "table" | "board"
type EditorState =
export type CompanyEditorState =
| { mode: "create" }
| { mode: "edit"; company: NormalizedCompany }
@ -299,7 +299,7 @@ export function AdminCompaniesManager({ initialCompanies, tenantId, autoOpenCrea
const [contractFilter, setContractFilter] = useState<string>("all")
const [regulatedFilter, setRegulatedFilter] = useState<string>("all")
const [isRefreshing, startRefresh] = useTransition()
const [editor, setEditor] = useState<EditorState | null>(null)
const [editor, setEditor] = useState<CompanyEditorState | null>(null)
const [isDeleting, setIsDeleting] = useState<NormalizedCompany | null>(null)
const [alertsBySlug, setAlertsBySlug] = useState<Record<string, LastAlertInfo>>({})
@ -979,13 +979,13 @@ function TableView({ companies, machineCountsBySlug, onEdit, onDelete }: TableVi
type CompanySheetProps = {
tenantId: string
editor: EditorState | null
editor: CompanyEditorState | null
onClose(): void
onCreated(company: NormalizedCompany): void
onUpdated(company: NormalizedCompany): void
}
function CompanySheet({ tenantId, editor, onClose, onCreated, onUpdated }: CompanySheetProps) {
export function CompanySheet({ tenantId, editor, onClose, onCreated, onUpdated }: CompanySheetProps) {
const [isSubmitting, startSubmit] = useTransition()
const open = Boolean(editor)