feat: add sleep report page
This commit is contained in:
28
src/components/report/insight-list.tsx
Normal file
28
src/components/report/insight-list.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import { Text, View } from "@tarojs/components";
|
||||
import type { InsightItem } from "../../pages/report/types";
|
||||
|
||||
type ReportInsightListProps = {
|
||||
title: string;
|
||||
items: InsightItem[];
|
||||
};
|
||||
|
||||
export function ReportInsightList({ title, items }: ReportInsightListProps) {
|
||||
return (
|
||||
<View className="report-card">
|
||||
<View className="report-card__header">
|
||||
<Text className="report-card__title">{title}</Text>
|
||||
</View>
|
||||
<View className="insight-list">
|
||||
{items.map((item) => (
|
||||
<View className="insight-card" key={item.title}>
|
||||
<View className={`insight-card__tone insight-card__tone--${item.tone}`} />
|
||||
<View className="insight-card__content">
|
||||
<Text className="insight-card__title">{item.title}</Text>
|
||||
<Text className="insight-card__body">{item.body}</Text>
|
||||
</View>
|
||||
</View>
|
||||
))}
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user