diff --git a/apps/web/package.json b/apps/web/package.json index 1ccb5cd..89dc198 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -11,6 +11,7 @@ "dependencies": { "@conform-to/react": "^1.1.5", "@conform-to/zod": "^1.1.5", + "@icons-pack/react-simple-icons": "^10.0.0", "@peace-net/shared": "workspace:*", "@peace-net/ui": "workspace:*", "@squircle-js/react": "^1.2.0", diff --git a/apps/web/src/app/(main)/dashboard/(palygroud)/components/playground-form.tsx b/apps/web/src/app/(main)/dashboard/(palygroud)/components/playground-form.tsx index 6615b9f..7caec1d 100644 --- a/apps/web/src/app/(main)/dashboard/(palygroud)/components/playground-form.tsx +++ b/apps/web/src/app/(main)/dashboard/(palygroud)/components/playground-form.tsx @@ -2,6 +2,7 @@ import { getFormProps, useForm } from '@conform-to/react' import { getZodConstraint, parseWithZod } from '@conform-to/zod' +import { SiAnthropic, SiGoogle, SiOpenai } from '@icons-pack/react-simple-icons' import { Button } from '@peace-net/ui/components/ui/button' import { Label } from '@peace-net/ui/components/ui/label' import { Loader2Icon, PlayIcon } from 'lucide-react' @@ -9,6 +10,7 @@ import { useActionState } from 'react' import { Field, FieldError } from '~/components/common/field' import { RadioGroupConform } from '~/components/conform/radio-group' +import { SelectConform } from '~/components/conform/select' import { SliderConform } from '~/components/conform/slider' import { TextareaConform } from '~/components/conform/textarea' @@ -41,6 +43,9 @@ export function PlaygroundForm() { score_threshold: isSuccessResult(lastResult) ? lastResult.value.score_threshold : 0.5, + model: isSuccessResult(lastResult) + ? lastResult.value.model + : 'gpt-4o-mini', result: isSuccessResult(lastResult) ? lastResult.value.result : '', }, }) @@ -95,6 +100,29 @@ export function PlaygroundForm() { )} )} + + + + {fields.model.errors && ( + {fields.model.errors} + )} + + items: Array<{ name: string; value: string; Icon?: IconType }> + placeholder: string +} & ComponentProps) => { + const selectRef = useRef>(null) + const control = useControl(meta) + + return ( + <> + + + + + ) +} diff --git a/packages/ui/src/components/ui/select.tsx b/packages/ui/src/components/ui/select.tsx index a608c73..ff41a07 100644 --- a/packages/ui/src/components/ui/select.tsx +++ b/packages/ui/src/components/ui/select.tsx @@ -125,7 +125,7 @@ const SelectItem = React.forwardRef< > - + diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6d381ad..5ea74bf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -124,6 +124,9 @@ importers: '@conform-to/zod': specifier: ^1.1.5 version: 1.1.5(zod@3.23.8) + '@icons-pack/react-simple-icons': + specifier: ^10.0.0 + version: 10.0.0(react@19.0.0-rc-8269d55d-20240802) '@peace-net/shared': specifier: workspace:* version: link:../../packages/shared @@ -1694,6 +1697,11 @@ packages: resolution: {integrity: sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==} deprecated: Use @eslint/object-schema instead + '@icons-pack/react-simple-icons@10.0.0': + resolution: {integrity: sha512-oU0PVDx9sbNQjRxJN555dsHbRApYN+aBq/O9+wo3JgNkEfvBMgAEtsSGtXWWXQsLAxJcYiFOCzBWege/Xj/JFQ==} + peerDependencies: + react: ^16.13 || ^17 || ^18 + '@img/sharp-darwin-arm64@0.33.4': resolution: {integrity: sha512-p0suNqXufJs9t3RqLBO6vvrgr5OhgbWp76s5gTRvdmxmuv9E1rcaqGUsl3l4mKVmXPkTkTErXediAui4x+8PSA==} engines: {glibc: '>=2.26', node: ^18.17.0 || ^20.3.0 || >=21.0.0, npm: '>=9.6.5', pnpm: '>=7.1.0', yarn: '>=3.2.0'} @@ -10581,6 +10589,10 @@ snapshots: '@humanwhocodes/object-schema@2.0.2': {} + '@icons-pack/react-simple-icons@10.0.0(react@19.0.0-rc-8269d55d-20240802)': + dependencies: + react: 19.0.0-rc-8269d55d-20240802 + '@img/sharp-darwin-arm64@0.33.4': optionalDependencies: '@img/sharp-libvips-darwin-arm64': 1.0.2