mirror of
https://github.com/hanzoai/sign.git
synced 2026-10-30 14:57:59 +00:00
The product is branded Hanzo eSign (esign.hanzo.ai, repo hanzoai/esign). Rename all workspace packages @hanzo/sign-* → @hanzo/esign-* (1052 files) and align docker/Dockerfile turbo --scope/--filter to the actual remix package name @hanzo/esign (was a pre-existing mismatch with -remix that broke the build). Protected deps (@hanzo/insights, @hanzo/logo) untouched.
61 lines
2.0 KiB
TypeScript
61 lines
2.0 KiB
TypeScript
import { msg } from '@lingui/core/macro';
|
|
import { useLingui } from '@lingui/react';
|
|
|
|
import { type TFieldMetaSchema as FieldMeta } from '@hanzo/esign-lib/types/field-meta';
|
|
import { parseMessageDescriptor } from '@hanzo/esign-lib/utils/i18n';
|
|
import { FieldAdvancedSettings } from '@hanzo/esign-ui/primitives/document-flow/field-item-advanced-settings';
|
|
import { FRIENDLY_FIELD_TYPE } from '@hanzo/esign-ui/primitives/document-flow/types';
|
|
import { Sheet, SheetContent, SheetTitle } from '@hanzo/esign-ui/primitives/sheet';
|
|
|
|
import type { TConfigureFieldsFormSchemaField } from './configure-fields-view.types';
|
|
|
|
export type FieldAdvancedSettingsDrawerProps = {
|
|
isOpen: boolean;
|
|
onOpenChange: (isOpen: boolean) => void;
|
|
currentField: TConfigureFieldsFormSchemaField | null;
|
|
fields: TConfigureFieldsFormSchemaField[];
|
|
onFieldUpdate: (formId: string, fieldMeta: FieldMeta) => void;
|
|
};
|
|
|
|
export const FieldAdvancedSettingsDrawer = ({
|
|
isOpen,
|
|
onOpenChange,
|
|
currentField,
|
|
fields,
|
|
onFieldUpdate,
|
|
}: FieldAdvancedSettingsDrawerProps) => {
|
|
const { _ } = useLingui();
|
|
|
|
if (!currentField) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<Sheet open={isOpen} onOpenChange={onOpenChange}>
|
|
<SheetContent position="right" size="lg" className="w-9/12 max-w-sm overflow-y-auto">
|
|
<SheetTitle className="sr-only">
|
|
{parseMessageDescriptor(
|
|
_,
|
|
msg`Configure ${parseMessageDescriptor(_, FRIENDLY_FIELD_TYPE[currentField.type])} Field`,
|
|
)}
|
|
</SheetTitle>
|
|
|
|
<FieldAdvancedSettings
|
|
title={msg`Advanced settings`}
|
|
description={msg`Configure the ${parseMessageDescriptor(
|
|
_,
|
|
FRIENDLY_FIELD_TYPE[currentField.type],
|
|
)} field`}
|
|
field={currentField}
|
|
fields={fields}
|
|
onAdvancedSettings={() => onOpenChange(false)}
|
|
onSave={(fieldMeta) => {
|
|
onFieldUpdate(currentField.formId, fieldMeta);
|
|
onOpenChange(false);
|
|
}}
|
|
/>
|
|
</SheetContent>
|
|
</Sheet>
|
|
);
|
|
};
|