feat: shared type package

This commit is contained in:
Nicolas Meienberger
2025-09-02 21:59:26 +02:00
parent 9ef21d4ec2
commit de0ae08008
12 changed files with 82 additions and 43 deletions

View File

@@ -1,4 +1,5 @@
import { arktypeResolver } from "@hookform/resolvers/arktype";
import { volumeConfigSchema } from "@ironmount/schemas";
import { type } from "arktype";
import { Plus } from "lucide-react";
import { useForm } from "react-hook-form";
@@ -19,15 +20,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from ".
export const formSchema = type({
name: "2<=string<=32",
backend: "'directory'",
}).or({
name: "2<=string<=32",
backend: "'nfs'",
server: "string",
exportPath: "string",
port: "number >= 1",
version: "'3' | '4' | '4.1'",
});
}).and(volumeConfigSchema);
type FormValues = typeof formSchema.infer;
type Props = {