mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-18 06:49:50 +02:00
Run oxfmt across repo, add format script and docs
Add .oxfmtignore to skip generated bindings and wasm-pack output. Add npm format script, update DEVELOPMENT.md for Vite+ toolchain, and format all non-generated files with oxfmt. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
import type { AnyModel } from '@yaakapp-internal/models';
|
||||
import { deleteModel, modelTypeLabel } from '@yaakapp-internal/models';
|
||||
import { InlineCode } from '../components/core/InlineCode';
|
||||
import { Prose } from '../components/Prose';
|
||||
import { showConfirmDelete } from './confirm';
|
||||
import { pluralizeCount } from './pluralize';
|
||||
import { resolvedModelName } from './resolvedModelName';
|
||||
import type { AnyModel } from "@yaakapp-internal/models";
|
||||
import { deleteModel, modelTypeLabel } from "@yaakapp-internal/models";
|
||||
import { InlineCode } from "../components/core/InlineCode";
|
||||
import { Prose } from "../components/Prose";
|
||||
import { showConfirmDelete } from "./confirm";
|
||||
import { pluralizeCount } from "./pluralize";
|
||||
import { resolvedModelName } from "./resolvedModelName";
|
||||
|
||||
export async function deleteModelWithConfirm(
|
||||
model: AnyModel | AnyModel[] | null,
|
||||
options: { confirmName?: string } = {},
|
||||
): Promise<boolean> {
|
||||
if (model == null) {
|
||||
console.warn('Tried to delete null model');
|
||||
console.warn("Tried to delete null model");
|
||||
return false;
|
||||
}
|
||||
const models = Array.isArray(model) ? model : [model];
|
||||
@@ -19,14 +19,14 @@ export async function deleteModelWithConfirm(
|
||||
if (firstModel == null) return false;
|
||||
|
||||
const descriptor =
|
||||
models.length === 1 ? modelTypeLabel(firstModel) : pluralizeCount('Item', models.length);
|
||||
models.length === 1 ? modelTypeLabel(firstModel) : pluralizeCount("Item", models.length);
|
||||
const confirmed = await showConfirmDelete({
|
||||
id: `delete-model-${models.map((m) => m.id).join(',')}`,
|
||||
id: `delete-model-${models.map((m) => m.id).join(",")}`,
|
||||
title: `Delete ${descriptor}`,
|
||||
requireTyping: options.confirmName,
|
||||
description: (
|
||||
<>
|
||||
Permanently delete{' '}
|
||||
Permanently delete{" "}
|
||||
{models.length === 1 ? (
|
||||
<>
|
||||
<InlineCode>{resolvedModelName(firstModel)}</InlineCode>?
|
||||
@@ -45,7 +45,7 @@ export async function deleteModelWithConfirm(
|
||||
</Prose>
|
||||
</>
|
||||
) : (
|
||||
`all ${pluralizeCount('item', models.length)}?`
|
||||
`all ${pluralizeCount("item", models.length)}?`
|
||||
)}
|
||||
</>
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user