/*! * Copyright (c) Microsoft. All rights reserved. * Licensed under the MIT license. See LICENSE file in the project. */ import { DataType } from '@datashaper/schema' import { columnType } from '@datashaper/tables' import type ColumnTable from 'arquero/dist/types/table/column-table' import { useMemo } from 'react' export function useColumnType(table?: ColumnTable, column?: string): DataType { return useMemo(() => { if (!(table && column)) { return DataType.Unknown } return columnType(table, column) }, [table, column]) }