mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-22 20:36:08 +00:00
feat: marketplace page
This commit is contained in:
@@ -12,7 +12,7 @@ import {
|
||||
} from '@/components/ui/form';
|
||||
import DynamicFormItemComponent from '@/app/home/components/dynamic-form/DynamicFormItemComponent';
|
||||
import { useEffect } from 'react';
|
||||
import { i18nObj } from '@/i18n/I18nProvider';
|
||||
import { extractI18nObject } from '@/i18n/I18nProvider';
|
||||
|
||||
export default function DynamicFormComponent({
|
||||
itemConfigList,
|
||||
@@ -142,7 +142,7 @@ export default function DynamicFormComponent({
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>
|
||||
{i18nObj(config.label)}{' '}
|
||||
{extractI18nObject(config.label)}{' '}
|
||||
{config.required && <span className="text-red-500">*</span>}
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
@@ -150,7 +150,7 @@ export default function DynamicFormComponent({
|
||||
</FormControl>
|
||||
{config.description && (
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{i18nObj(config.description)}
|
||||
{extractI18nObject(config.description)}
|
||||
</p>
|
||||
)}
|
||||
<FormMessage />
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
HoverCardTrigger,
|
||||
} from '@/components/ui/hover-card';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { i18nObj } from '@/i18n/I18nProvider';
|
||||
import { extractI18nObject } from '@/i18n/I18nProvider';
|
||||
|
||||
export default function DynamicFormItemComponent({
|
||||
config,
|
||||
@@ -124,7 +124,7 @@ export default function DynamicFormItemComponent({
|
||||
<SelectGroup>
|
||||
{config.options?.map((option) => (
|
||||
<SelectItem key={option.name} value={option.name}>
|
||||
{i18nObj(option.label)}
|
||||
{extractI18nObject(option.label)}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectGroup>
|
||||
|
||||
@@ -3,16 +3,16 @@ import {
|
||||
DynamicFormItemType,
|
||||
IDynamicFormItemOption,
|
||||
} from '@/app/infra/entities/form/dynamic';
|
||||
import { I18nLabel } from '@/app/infra/entities/common';
|
||||
import { I18nObject } from '@/app/infra/entities/common';
|
||||
|
||||
export class DynamicFormItemConfig implements IDynamicFormItemSchema {
|
||||
id: string;
|
||||
name: string;
|
||||
default: string | number | boolean | Array<unknown>;
|
||||
label: I18nLabel;
|
||||
label: I18nObject;
|
||||
required: boolean;
|
||||
type: DynamicFormItemType;
|
||||
description?: I18nLabel;
|
||||
description?: I18nObject;
|
||||
options?: IDynamicFormItemOption[];
|
||||
|
||||
constructor(params: IDynamicFormItemSchema) {
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
} from '@/components/ui/form';
|
||||
import { IDynamicFormItemSchema } from '@/app/infra/entities/form/dynamic';
|
||||
import DynamicFormItemComponent from '@/app/home/components/dynamic-form/DynamicFormItemComponent';
|
||||
import { i18nObj } from '@/i18n/I18nProvider';
|
||||
import { extractI18nObject } from '@/i18n/I18nProvider';
|
||||
|
||||
/**
|
||||
* N8n认证表单组件
|
||||
@@ -182,7 +182,7 @@ export default function N8nAuthFormComponent({
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>
|
||||
{i18nObj(config.label)}{' '}
|
||||
{extractI18nObject(config.label)}{' '}
|
||||
{config.required && <span className="text-red-500">*</span>}
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
@@ -190,7 +190,7 @@ export default function N8nAuthFormComponent({
|
||||
</FormControl>
|
||||
{config.description && (
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{i18nObj(config.description)}
|
||||
{extractI18nObject(config.description)}
|
||||
</p>
|
||||
)}
|
||||
<FormMessage />
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import styles from './HomeSidebar.module.css';
|
||||
import { I18nLabel } from '@/app/infra/entities/common';
|
||||
import { I18nObject } from '@/app/infra/entities/common';
|
||||
|
||||
export interface ISidebarChildVO {
|
||||
id: string;
|
||||
@@ -7,7 +7,7 @@ export interface ISidebarChildVO {
|
||||
name: string;
|
||||
route: string;
|
||||
description: string;
|
||||
helpLink: I18nLabel;
|
||||
helpLink: I18nObject;
|
||||
}
|
||||
|
||||
export class SidebarChildVO {
|
||||
@@ -16,7 +16,7 @@ export class SidebarChildVO {
|
||||
name: string;
|
||||
route: string;
|
||||
description: string;
|
||||
helpLink: I18nLabel;
|
||||
helpLink: I18nObject;
|
||||
|
||||
constructor(props: ISidebarChildVO) {
|
||||
this.id = props.id;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { i18nObj } from '@/i18n/I18nProvider';
|
||||
import { extractI18nObject } from '@/i18n/I18nProvider';
|
||||
import styles from './HomeTittleBar.module.css';
|
||||
import { I18nLabel } from '@/app/infra/entities/common';
|
||||
import { I18nObject } from '@/app/infra/entities/common';
|
||||
|
||||
export default function HomeTitleBar({
|
||||
title,
|
||||
@@ -9,7 +9,7 @@ export default function HomeTitleBar({
|
||||
}: {
|
||||
title: string;
|
||||
subtitle: string;
|
||||
helpLink: I18nLabel;
|
||||
helpLink: I18nObject;
|
||||
}) {
|
||||
return (
|
||||
<div className={`${styles.titleBarContainer}`}>
|
||||
@@ -19,7 +19,7 @@ export default function HomeTitleBar({
|
||||
<span className={`${styles.helpLink}`}>
|
||||
<div
|
||||
onClick={() => {
|
||||
window.open(i18nObj(helpLink), '_blank');
|
||||
window.open(extractI18nObject(helpLink), '_blank');
|
||||
}}
|
||||
className="cursor-pointer"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user