357c2882ad
* refactor: apply biome formatting to Phase 1 packages Packages formatted: - packages/app-store-cli - packages/config - packages/dayjs - packages/debugging - packages/embeds/embed-react - packages/embeds/embed-snippet - packages/kysely - packages/platform/constants - packages/platform/utils - packages/testing - packages/tsconfig Co-Authored-By: eunjae@cal.com <hey@eunjae.dev> * fix: restore non-null assertions in embed-snippet to fix type error Co-Authored-By: eunjae@cal.com <hey@eunjae.dev> * fix: remove ESM import from CommonJS config file Biome incorrectly added 'import process from node:process' to a CommonJS file that uses require(). This breaks Jest which expects CommonJS syntax. The process global is already available in Node.js without explicit import. Co-Authored-By: eunjae@cal.com <hey@eunjae.dev> * refactor: exclude packages/embeds from Phase 1 formatting Per user request, reverting all biome formatting changes in packages/embeds to handle separately. Co-Authored-By: eunjae@cal.com <hey@eunjae.dev> * fix: restore const enum for BookingLocations Biome changed 'const enum' to 'enum' which is a semantic change. Reverting to keep the PR purely formatting-only. Co-Authored-By: eunjae@cal.com <hey@eunjae.dev> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
49 lines
1.2 KiB
TypeScript
49 lines
1.2 KiB
TypeScript
import type { FC } from "react";
|
|
import type { SupportedCommands } from "src/types";
|
|
import Create from "./commandViews/Create";
|
|
import CreateTemplate from "./commandViews/Create";
|
|
import Delete from "./commandViews/Delete";
|
|
import DeleteTemplate from "./commandViews/DeleteTemplate";
|
|
import Edit from "./commandViews/Edit";
|
|
import EditTemplate from "./commandViews/EditTemplate";
|
|
|
|
export const App: FC<{
|
|
template: string;
|
|
command: SupportedCommands;
|
|
slug?: string;
|
|
}> = ({ command, template, slug }) => {
|
|
if (command === "create") {
|
|
return <Create template={template} />;
|
|
}
|
|
|
|
if (command === "edit") {
|
|
return <Edit slug={slug} />;
|
|
}
|
|
|
|
if (command === "edit-template") {
|
|
return <EditTemplate slug={slug} />;
|
|
}
|
|
|
|
if (command === "delete") {
|
|
if (!slug) {
|
|
throw new Error('Slug is required for "delete" command');
|
|
}
|
|
return <Delete slug={slug} />;
|
|
}
|
|
|
|
if (command === "create-template") {
|
|
return <CreateTemplate template={template} />;
|
|
}
|
|
|
|
if (command === "delete-template") {
|
|
if (!slug) {
|
|
throw new Error('Slug is required for "delete-template" command');
|
|
}
|
|
return <DeleteTemplate slug={slug} />;
|
|
}
|
|
|
|
return null;
|
|
};
|
|
|
|
export default App;
|