mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 10:06:51 +08:00
chore(web): remove unused data
This commit is contained in:
parent
70fd4a5c88
commit
c574363cf6
@ -154,7 +154,6 @@ const mockSnippet: SnippetDetail = {
|
||||
id: 'snippet-1',
|
||||
name: 'Social Media Repurposer',
|
||||
description: 'Turn one blog post into multiple social media variations.',
|
||||
author: 'Dify',
|
||||
updatedAt: '2026-03-25 10:00',
|
||||
usage: '12',
|
||||
icon: '🤖',
|
||||
|
||||
@ -11,7 +11,6 @@ const mockSnippet: SnippetDetail = {
|
||||
id: 'snippet-1',
|
||||
name: 'Social Media Repurposer',
|
||||
description: 'Turn one blog post into multiple social media variations.',
|
||||
author: 'Dify',
|
||||
updatedAt: '2026-03-25 10:00',
|
||||
usage: '12',
|
||||
icon: '🤖',
|
||||
|
||||
@ -91,7 +91,6 @@ const mockSnippetDetail: SnippetDetailPayload = {
|
||||
id: 'snippet-1',
|
||||
name: 'Tone Rewriter',
|
||||
description: 'A static snippet mock.',
|
||||
author: 'Evan',
|
||||
updatedAt: 'Updated 2h ago',
|
||||
usage: 'Used 19 times',
|
||||
icon: '🪄',
|
||||
|
||||
@ -79,7 +79,6 @@ const mockSnippetDetail: SnippetDetailPayload = {
|
||||
id: 'snippet-1',
|
||||
name: 'Tone Rewriter',
|
||||
description: 'A static snippet mock.',
|
||||
author: 'Evan',
|
||||
updatedAt: '2024-03-24',
|
||||
usage: '19',
|
||||
icon: '🪄',
|
||||
|
||||
@ -66,7 +66,6 @@ const createSnippet = (overrides: Partial<SnippetDetail> = {}): SnippetDetail =>
|
||||
id: 'snippet-1',
|
||||
name: 'Snippet Title',
|
||||
description: 'Snippet description',
|
||||
author: 'tester',
|
||||
updatedAt: '2026-04-15',
|
||||
usage: '42',
|
||||
icon: 'emoji',
|
||||
|
||||
@ -172,7 +172,6 @@ const payload: SnippetDetailPayload = {
|
||||
id: 'snippet-1',
|
||||
name: 'Snippet',
|
||||
description: 'desc',
|
||||
author: '',
|
||||
updatedAt: '2026-03-29 10:00',
|
||||
usage: '0',
|
||||
icon: '',
|
||||
|
||||
@ -22,7 +22,7 @@ const SnippetDetailCard: FC<SnippetDetailCardProps> = ({
|
||||
const { data: membersData } = useMembers()
|
||||
const { data: workflow } = useSnippetPublishedWorkflow(snippet.id)
|
||||
|
||||
const authorName = useMemo(() => {
|
||||
const creatorName = useMemo(() => {
|
||||
const member = membersData?.accounts?.find(member => member.id === snippet.created_by)
|
||||
return member?.name || t('unknownUser')
|
||||
}, [membersData?.accounts, snippet.created_by, t])
|
||||
@ -90,7 +90,7 @@ const SnippetDetailCard: FC<SnippetDetailCardProps> = ({
|
||||
)}
|
||||
</div>
|
||||
<div className="pt-3 system-xs-regular text-text-tertiary">
|
||||
{authorName}
|
||||
{creatorName}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@ -8,7 +8,6 @@ export type SnippetListItem = {
|
||||
id: string
|
||||
name: string
|
||||
description: string
|
||||
author: string
|
||||
updatedAt: string
|
||||
usage: string
|
||||
icon: string
|
||||
@ -21,7 +20,6 @@ export type SnippetDetail = {
|
||||
id: string
|
||||
name: string
|
||||
description: string
|
||||
author: string
|
||||
updatedAt: string
|
||||
usage: string
|
||||
icon: string
|
||||
|
||||
@ -15,7 +15,6 @@ const getSnippetListMock = (): SnippetListItem[] => ([
|
||||
id: 'snippet-1',
|
||||
name: 'Tone Rewriter',
|
||||
description: 'Rewrites rough drafts into a concise, professional tone for internal stakeholder updates.',
|
||||
author: 'Evan',
|
||||
updatedAt: 'Updated 2h ago',
|
||||
usage: 'Used 19 times',
|
||||
icon: '🪄',
|
||||
@ -28,7 +27,6 @@ const createSnippetMock = (snippetId: string): SnippetListItem => ({
|
||||
id: snippetId,
|
||||
name: 'Tone Rewriter',
|
||||
description: 'Rewrites rough drafts into a concise, professional tone for internal stakeholder updates.',
|
||||
author: 'Evan',
|
||||
updatedAt: 'Updated 2h ago',
|
||||
usage: 'Used 19 times',
|
||||
icon: '🪄',
|
||||
|
||||
@ -70,7 +70,6 @@ const toSnippetListItem = (snippet: SnippetSummary): SnippetListItemUIModel => {
|
||||
id: snippet.id,
|
||||
name: snippet.name,
|
||||
description: snippet.description,
|
||||
author: '',
|
||||
updatedAt: formatTimestamp(snippet.updated_at),
|
||||
usage: String(snippet.use_count ?? 0),
|
||||
icon: getSnippetIcon(snippet.icon_info),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user