Skip to content

Commit

Permalink
add ArrayOfObjectsInputProps
Browse files Browse the repository at this point in the history
  • Loading branch information
christinaroise committed Sep 25, 2024
1 parent 2fd1d6b commit 52e94e3
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions studio/components/LanguageSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
import { Box, Button, Card, Checkbox, Flex, useTheme } from "@sanity/ui";
import React from "react";
import { PatchEvent, set } from "sanity";
import { ArrayOfObjectsInputProps, PatchEvent, set } from "sanity";

import {
Language,
supportedLanguages,
} from "internationalization/supportedLanguages";

interface LanguageSelectorProps {
value?: Language[];
onChange: (event: PatchEvent) => void;
}

const colorMap = {
dark: {
selected: "#29356a",
Expand All @@ -23,7 +18,10 @@ const colorMap = {
},
};

const LanguageSelector = ({ value = [], onChange }: LanguageSelectorProps) => {
const LanguageSelector = ({
value = [],
onChange,
}: ArrayOfObjectsInputProps<Language>) => {
const theme = useTheme();
const prefersDark = theme.sanity.v2?.color._dark ?? false;
const themeType = prefersDark ? "dark" : "light";
Expand Down

0 comments on commit 52e94e3

Please sign in to comment.