88} from "@/components/ui/table" ;
99import { Constraint , hasConstraint , setConstraint } from "@/lib/schema" ;
1010import { CheckedState } from "@radix-ui/react-checkbox" ;
11- import { schema } from "@tableland/studio-store" ;
11+ import { Schema } from "@tableland/studio-store" ;
1212import { Plus , X } from "lucide-react" ;
1313import { Dispatch , SetStateAction } from "react" ;
1414import { Button } from "./ui/button" ;
@@ -31,8 +31,8 @@ export default function SchemaBuilder({
3131 schema,
3232 setSchema,
3333} : {
34- schema : schema . Schema ;
35- setSchema : Dispatch < SetStateAction < schema . Schema > > ;
34+ schema : Schema ;
35+ setSchema : Dispatch < SetStateAction < Schema > > ;
3636} ) {
3737 return (
3838 < div className = "flex flex-col items-start" >
@@ -71,10 +71,7 @@ export default function SchemaBuilder({
7171 setSchema ( ( prev ) => {
7272 return {
7373 ...prev ,
74- columns : [
75- ...prev . columns ,
76- { name : "" , type : "text" , constraints : [ ] } ,
77- ] ,
74+ columns : [ ...prev . columns , { name : "" , type : "text" } ] ,
7875 } ;
7976 } ) ;
8077 } }
@@ -91,7 +88,7 @@ function RemoveColumn({
9188 setSchema,
9289} : {
9390 columnIndex : number ;
94- setSchema : Dispatch < SetStateAction < schema . Schema > > ;
91+ setSchema : Dispatch < SetStateAction < Schema > > ;
9592} ) {
9693 return (
9794 < Button
@@ -118,8 +115,8 @@ function CreateColumn({
118115 setSchema,
119116} : {
120117 columnIndex : number ;
121- schema : schema . Schema ;
122- setSchema : Dispatch < SetStateAction < schema . Schema > > ;
118+ schema : Schema ;
119+ setSchema : Dispatch < SetStateAction < Schema > > ;
123120} ) {
124121 const column = schema . columns [ columnIndex ] ;
125122
0 commit comments