Skip to content

Commit

Permalink
fix(general): fix project types
Browse files Browse the repository at this point in the history
  • Loading branch information
davidecarpini committed Mar 22, 2024
1 parent e2bf3a7 commit dde077c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
6 changes: 2 additions & 4 deletions components/app/project/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ import { DownloadKeywordsDropdownMenu } from "./dialogs/download"
import ImportKeywordsModal from "./dialogs/import-keywords"
import ProjectSettingsSlideOver from "./settings-slide-over"
import Table from "./table/table"
import { ProjectData } from "./types"
import useTranslation from "./useTranslation"

export interface EditorProps {
project: Pick<
Project,
"id" | "title" | "languages" | "published" | "info" | "settings"
>
project: ProjectData
}

export function Editor(props: EditorProps) {
Expand Down
4 changes: 2 additions & 2 deletions components/app/project/table/detail-slide-over.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ChangeEvent, useCallback, useState } from "react"
import { Project } from "@prisma/client"

import i18n from "@/lib/i18n"
import { Button } from "@/components/ui/button"
import SlideOver, { SlideOverRow } from "@/components/slide-over"

import { ProjectData } from "../types"
import { Keyword } from "../useTranslation"

type Props = {
Expand All @@ -15,7 +15,7 @@ type Props = {
editContext: (key: string, context: string) => void
editKey: (key: string, newKey: string) => void
checkIfKeyAlreadyExists: (key: string) => boolean
project: Project
project: ProjectData
}

const DetailSlideOver = (props: Props) => {
Expand Down
4 changes: 2 additions & 2 deletions components/app/project/table/table.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"use client"

import { useCallback, useMemo, useState } from "react"
import { Project } from "@prisma/client"

import i18n from "@/lib/i18n"

import AddNewKeyword, { NewKeyword } from "../dialogs/add-new-keyword"
import { ProjectData } from "../types"
import { Keyword } from "../useTranslation"
import DetailSlideOver from "./detail-slide-over"
import Row from "./row"
Expand All @@ -19,7 +19,7 @@ type Props = {
editContext: (key: string, context: string) => void
editKey: (key: string, newKey: string) => void
checkIfKeyAlreadyExists: (key: string) => boolean
project: Project
project: ProjectData
}

const Table = (props: Props) => {
Expand Down
6 changes: 6 additions & 0 deletions components/app/project/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { Project } from "@prisma/client"

export type ProjectData = Pick<
Project,
"id" | "title" | "languages" | "published" | "info" | "settings"
>

0 comments on commit dde077c

Please sign in to comment.