Revert "Upgrade linter and formatter to Ultracite" (#1226)
This commit is contained in:
parent
0e320b391d
commit
1aff7d9868
177 changed files with 8334 additions and 6943 deletions
|
|
@ -1,16 +1,15 @@
|
|||
"use client";
|
||||
'use client';
|
||||
|
||||
import type { DataUIPart } from "ai";
|
||||
import type React from "react";
|
||||
import { createContext, useContext, useMemo, useState } from "react";
|
||||
import type { CustomUIDataTypes } from "@/lib/types";
|
||||
import React, { createContext, useContext, useMemo, useState } from 'react';
|
||||
import type { DataUIPart } from 'ai';
|
||||
import type { CustomUIDataTypes } from '@/lib/types';
|
||||
|
||||
type DataStreamContextValue = {
|
||||
interface DataStreamContextValue {
|
||||
dataStream: DataUIPart<CustomUIDataTypes>[];
|
||||
setDataStream: React.Dispatch<
|
||||
React.SetStateAction<DataUIPart<CustomUIDataTypes>[]>
|
||||
>;
|
||||
};
|
||||
}
|
||||
|
||||
const DataStreamContext = createContext<DataStreamContextValue | null>(null);
|
||||
|
||||
|
|
@ -20,7 +19,7 @@ export function DataStreamProvider({
|
|||
children: React.ReactNode;
|
||||
}) {
|
||||
const [dataStream, setDataStream] = useState<DataUIPart<CustomUIDataTypes>[]>(
|
||||
[]
|
||||
[],
|
||||
);
|
||||
|
||||
const value = useMemo(() => ({ dataStream, setDataStream }), [dataStream]);
|
||||
|
|
@ -35,7 +34,7 @@ export function DataStreamProvider({
|
|||
export function useDataStream() {
|
||||
const context = useContext(DataStreamContext);
|
||||
if (!context) {
|
||||
throw new Error("useDataStream must be used within a DataStreamProvider");
|
||||
throw new Error('useDataStream must be used within a DataStreamProvider');
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue